`

使用jstl标签报错:According to TLD or attribute directive in tag file, attribute value

    博客分类:
  • java
阅读更多
原来jstl标签版本不一样,标签支持不一样。
jstl1.0标签库不支持表达式,如:
<c:if test="${query01 == null}">
  <jsp:forward page="/index.jsp"/>
</c:if>
在1.0下面,会报错:
According to TLD or attribute directive in tag file, attribute value
解决办法是使用备用库
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
它支持表达式


jstl 1.1之后,core就支持表达式了


使用jstl不需要在web.xml文件中配置标签库
只需把jstl.jar和stardard.jar放入WEB-INF/lib目录里,在jsp页面引入

注意1.0和1.1引入标签库的uri不同
1.0引入方式

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

1.1引入方式

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

相关推荐

Global site tag (gtag.js) - Google Analytics