org.apache.jasper.JasperException: /mainpage.jsp (line: 25, column: 2) According to TLD or attribute

	org.apache.jasper.JasperException: /mainpage.jsp (line: 25, column: 2) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
	

test does not support runtime expressions

jstl的标签地址是直接粘贴过来的,但是我却花费了大概一个小时的时间来处理这个报的警告(warning):

test does not support runtime expressionsvalue does not support runtime expressionsitems does not support runtime expressions

当我使用下面代码的时候:

<c:choose>
<c:when test="${pageContext.request.method=='POST'}"> blah blah blah </c:when>
<c:otherwise> blah blah blah </c:otherwise>
</c:choose>

原因:我导入了 JSTL 1.0 taglib,而不是JSTL 1.1 taglib。这两个路径差别不打,但是URI是不同的。
 

JSTL 1.0 taglib的路径如下:

<%@ taglib uri="http://java.sun.com/jstl/core"prefix="c"%> 

JSTL 1.1 taglib的路径如下:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core"prefix="c"%>

注意:这两个URI的不同就是一个有jsp,另一个没有。


org.apache.jasper.JasperException: /mainpage.jsp (line: 25, column: 2) According to TLD or attribute_第1张图片
	

你可能感兴趣的:(org.apache.jasper.JasperException: /mainpage.jsp (line: 25, column: 2) According to TLD or attribute)