问题描述:

在 JSP 页面中使用 JSTL 标签库,访问 JSP 页面时抛出了如下异常信息:

org.apache.jasper.JasperException: /index.jsp (line: , column: ) According to TLD or attribute directive in tag file, attribute value does not accept any expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:)
org.apache.jasper.compiler.Node$Root.accept(Node.java:)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:)
javax.servlet.http.HttpServlet.service(HttpServlet.java:)
…… ……

问题原因:

因为使用了 JSP 2.0, 但又没有使用 JSTL 标签库的备用版本(RT库)

解决方案:

方案1. 修改web.xml

将 web.xml 中的 声明由 2.4 或 2.5 版本的修改为 2.3 版本,如:

<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 标签库的有两种 taglib 伪指令, 其中 RT 库即是依赖于 JSP 传统的请求时属性值, 而不是依赖于 EL 来实现:

只要将

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

改为

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

注意:修改完后,重启Tomcat服务器,就可以修改完成了。

jstl错误排除:According to TLD or attribute directive in tag file, attribute value does not accept any expressions的更多相关文章

  1. 使用jstl报错: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 ex ...

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

    原来jstl标签版本不一样,标签支持不一样. jstl1.0标签库不支持表达式,如: <c:if test="${query01 == null}">   <js ...

  3. 错误处理——According to TLD or attribute directive in tag file, attribute test does not accept any expres

    应用部署运行的时候出现JSP异常, 发生在使用JSTL库的时候: According to TLD or attribute directive in tag file, attribute valu ...

  4. According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    1.错误描写叙述 2014-7-13 17:27:21 org.apache.jasper.compiler.TldLocationsCache tldScanJar 信息: At least one ...

  5. EL表达式报错:  According to TLD or attribute directive in tag file, attribute value does not accept any expressions

    EL表达式报错: According to TLD or attribute directive in tag file, attribute value does not accept any ex ...

  6. According to TLD or attribute directive in tag file, attribute test does not accept any expressions

    HTTP Status 500 - /WEB-INF/views/emp/list.jsp (line: 30, column: 4) According to TLD or attribute di ...

  7. According to TLD or attribute directive in tag file, attribute end does not accept any expressions

    问题描述: 在 JSP 页面中使用 JSTL 标签库,访问 JSP 页面时抛出了如下异常信息: org.apache.jasper.JasperException: /WEB-INF/manageUs ...

  8. 终极解法According to TLD or attribute directive in tag file, attribute select does not accept any expressions

    3天硬是是把这个问题解决了 有时候突然上个厕所灵感就来了 第一次向用JSTL解析xml 然后我想遍历整个xml文档打印出来 居然不让我输入变量 那让我怎么办啊 在网上各种找答案 说什么<%@ t ...

  9. According to TLD or attribute directive in tag file, attribute items does not accep t any expressions

    According to TLD or attribute directive in tag file, attribute items does not accep t any expression ...

随机推荐

  1. Java乐观锁的实现原理(案例)

    简要说明: 表设计时,需要往表里加一个version字段.每次查询时,查出带有version的数据记录,更新数据时,判断数据库里对应id的记录的version是否和查出的version相同.若相同,则 ...

  2. reading list

    Machine  Learning1. Deep Learningimagenet classification with deep convolutional neural networks. 20 ...

  3. SQL char Nvarchar 详解

    Nvarchar :  可变长度的 , Unicode 编码.  长度 1-4000,  1个汉子 或者 字符 都是 2个字节. 支持多语言, 配合 大写 N 可以防止出现乱码. char:   固定 ...

  4. HDU4627

    /*找规律,n是奇数那么就是n/2和n/2+1 如果n是偶数,那就是两种情况n/2-1,和n/2-2两种,比较一下大小就可以 思路来自:http://www.cnblogs.com/freezhan/ ...

  5. JSONP跨站访问

    js中几种实用的跨域方法原理详解 这里说的js跨域是指通过js在不同的域之间进行数据传输或通信,比如用ajax向一个不同的域请求数据,或者通过js获取页面中不同域的框架中(iframe)的数据.只要协 ...

  6. Python3:Django连接Mysql数据库时出错,'Did you install mysqlclient or MySQL-python?'

    Python3:Django连接Mysql数据库时出错,'Did you install mysqlclient or MySQL-python?' 一.原因 因为Python版本问题,MySQLdb ...

  7. 《网络攻防》 MSF基础应用

    20145224陈颢文 <网络攻防>MSF基础应用 基础问题回答 用自己的话解释什么是exploit,payload,encode: exploit:攻击手段,是能使攻击武器(payloa ...

  8. 转: 在hibernate中查询使用list,map定制返回类型

    在使用hibernate进行查询时,使用得最多的还是通过构建hql进行查询了.在查询的过程当中,除使用经常的查询对象方法之外,还会遇到查询一个属性,或一组聚集结果的情况.在这种情况下,我们通常就需要对 ...

  9. DevExpress 给TreeList添加右键菜单

    只有在右击节点时才会触发 private void treeList1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == Mou ...

  10. mac的一些配置

    1,基础知识 /etc/bashrc :是针对系统所有用户的全局变量,只有root用户才能修改这两个文件,对一般用户来说是他们是只读的.一般用户要想修改它们,可以在命令前加sudo,意思是以Root身 ...