執行某jsp頁面時,彈出如標題所示異常,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="沒有結果"/>
</body>
</html>
異常的原因是不能識別“${userInfo}”,解決辦法有兩種:
一、在page指令里,加入isELIgnored="true"屬性,即
<%@ page language="java" contentType="text/html;charset=gbk" isELIgnored="true" %>
二、把<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>變為:
<%@ taglib prefix="c" uri=
http://java.sun.com/jstl/core_rt %>
經過改動之后,jsp頁面能正常執行了。
posted on 2008-11-07 16:48
jiafang83 閱讀(27836)
評論(7) 編輯 收藏