JSTL的问题(According to TLD or attribute directive in tag file, attribute value does not accept any expressions)
来源:互联网 发布:看美剧的软件 编辑:程序博客网 时间:2024/06/04 19:08
环境: win2003 tomcat 5.5 JDK1.6上
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
</web-app>
jsp代码:
1+2+3 = ${1+2+3} <br>
1+2+3 = <c:out value="6" /> <br>
此时执行没有任何问题。
1+2+3 = <c:out value="${1+2+3}" />执行时就会出现:
According to TLD or attribute directive in tag file, attribute value does not accept any expressions
昨天少了一个jsp,所以一直出现问题。
写成
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
今天再试。发现JSTL1.1可以用。但是用JSTL1.0时,出现问题。
就是把JSTL1.1的库放到/WEB-INF/lib/ 下。
刚开始我是netbeans 5.5.1中的JSTL库拷贝出来发现可以用。后来用jstl1.1.2的库,也是可以用。
总结:
JSTL1.1的库 在JSP2.0(Servlet 2.4)及以后(推荐用JSTL1.1及以上)用:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
web.xml
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
</web-app>
在 Servlet2.3及以前,
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
比2.4以后版本少了jsp
web.xml
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
在Servlet2.3中最好用JSTL1.0,如果用JSTL1.1,请加上
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
</web-app>
把tld目录下的c.tld拷贝到/WEB-INF?下。
找到官方下载地址:
http://jakarta.apache.org/site/downloads/downloads_taglibs.html
选择 Standard 1.0 Taglib 和Standard 1.1 Taglib 可以下载jstl1.0和jstl1.1版本。
转自:http://www.cnblogs.com/fjchenq/archive/2007/09/21/901657.html
Exception:According to TLD or attribute directive in tag file, attribute value does not accept any expression
应用部署运行的时候出现JSP异常, 发生在使用JSTL库的时候: According to TLD or attribute directive in tag file, attribute value does not accept any expressions, 可能是因为使用了JSP2.0版本, 同时又没有使用JSTL core库的备用版本(RT库), 以下有两种处理方法:
1. 修改web.xml.
改为2.3版本的
<web-app>
2. 使用JSTL core RT库
JSTL core库的有两种taglib伪指令, 其中RT库即是依赖于JSP传统的请求时属性值, 而不是依赖于EL来实现(称为EL库.JSP2.0将支持EL)
JSP中使用<%@ taglib uri=http://java.sun.com/jstl/core prefix="c"%>在2.3版本都可以,在2.4就不行了, 难道是版本不兼容吗?
只要将
改为
就没有问题了
转自:http://www.blogjava.net/echo/archive/2008/08/15/102687.html
- JSTL的问题(According to TLD or attribute directive in tag file, attribute value does not accept any expressions)
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- PHP 题二
- PKU1061 解题报告 青蛙的约会 __用扩展欧几里得解模同余方程
- SNMP++软件包的编译过程记录
- 简易C++测试框架
- C# 中的委托和事件
- JSTL的问题(According to TLD or attribute directive in tag file, attribute value does not accept any expressions)
- 计算机病毒的由来
- ACM会用到的一些数学知识(转alpc01)
- (转贴)推荐-好题
- 国外开源软件网站-收,便于查看
- 常用SQL语句
- 请问如何动态实现播放语音文件[WEB学习示例]
- 090807项目进展
- OnLoad和Page_Load的区别