这是一个很简单的例子(demo2.jsp):
<%@ page isELIgnored="false" %>
<%@ taglib uri="jstl/core" prefix="c"%>
<html>
<head>
<title>Insert title here</title>
</head>
<body>
${param.ca }
<br/>
<%pageContext.setAttribute("a",4); %>
<c:if test="${a==4}">
a == 4
</c:if>
</body>
</html>访问http://localhost/demo2.jsp?ca=2的时候,出错:
org.apache.jasper.JasperException: /demo2.jsp(11,0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions
at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)然后,我去掉<%@ page isELIgnored="false" %>之后,页面却显示为:
${param.ca } 
a == 4 
看起来似乎<%@ page isELIgnored="false" %>与<c:有冲突,是这样吗?
我如何才能让页面显示为:
2
a==4