错误:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
2008-04-12 13:33
447 查看
在部属Web应用程序的时候没有出现问题,但是访问JSP页面时碰到了一个异常:According to TLD or attribute directive in tag file, attribute value does not accept any expressions,在网上查了下,发现问题出在jsp页面的JSTL引入上。解决方案有两:
1.修改web.xml.
将2.4版本的web-app xml schema改为2.3版本下的dtd
<web-app 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" version="2.4">
改为
<!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>
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"%>改为<%@ taglib uri=http://java.sun.com/jstl/core_rt prefix="c"%>即可。
这时候问题解决了,但我发现将代码再改回去时问题也没了,不知道是不是bug
1.修改web.xml.
将2.4版本的web-app xml schema改为2.3版本下的dtd
<web-app 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" version="2.4">
改为
<!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>
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"%>改为<%@ taglib uri=http://java.sun.com/jstl/core_rt prefix="c"%>即可。
这时候问题解决了,但我发现将代码再改回去时问题也没了,不知道是不是bug
相关文章推荐
- 使用JSTL tag时出现错误:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- 使用JSTL tag时出现错误: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
- 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
- JSTL:JSP中出现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
- JSP中出现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
- JSP中出现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异常原因及解决方法