執(zhí)行某jsp頁(yè)面時(shí),彈出如標(biāo)題所示異常,jsp代碼如下:
<%@ page language="java" contentType="text/html;charset=gbk" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
</head>
<body>
This is the result:
<c:out value="${userInfo}" default="沒有結(jié)果"/>
</body>
</html>
異常的原因是不能識(shí)別“${userInfo}”,解決辦法有兩種:
一、在page指令里,加入isELIgnored="true"屬性,即
<%@ page language="java" contentType="text/html;charset=gbk" isELIgnored="true" %>
二、把<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>變?yōu)椋?br />
<%@ taglib prefix="c" uri=
http://java.sun.com/jstl/core_rt %>
經(jīng)過改動(dòng)之后,jsp頁(yè)面能正常執(zhí)行了。
posted on 2008-11-07 16:48
jiafang83 閱讀(27835)
評(píng)論(7) 編輯 收藏