其他分享
首页 > 其他分享> > test does not support runtime 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,另一个没有。

结论:如果使用jsp版本的jstl的话会更好些。

标签:JSTL,support,blah,does,test,taglib,runtime
来源: https://blog.51cto.com/u_2870645/2882439