问题描述:

在 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. redis 笔记01 简单动态字符串、链表、字典、跳跃表、整数集合、压缩列表

    文中内容摘自<redis设计与实现> 简单动态字符串 1. Redis只会使用C字符串作为字面量,在大多数情况下,Redis使用SDS(Simple Dynamic String,简单动态 ...

  2. 【I/O】常见输入输出

    缓冲输入文件.输出文件 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; ...

  3. unbntu修改mac地址

    分享下Ubuntu下更改MAC地址的简单方法: 首先把网卡设备给 down 掉,否则会报告系统忙,无法更改. sudo ifconfig eth0 down 然后修改 MAC 地址,这一步较 Wind ...

  4. Mac开发

    工具类:                      

  5. JS复制内容到剪贴板: 兼容IE、Firefox、Chrome、Safari所有浏览器【转】

    正 文: 现在浏览器种类也越来越多,诸如 IE.Firefox.Chrome.Safari等等,因此现在要实现一个js复制内容到剪贴板的小功能就不是一件那么容易的事了. 在FLASH 9 时代,有一个 ...

  6. CentOS上使用sendmail发送邮件

    设置方法 set from=fromUser@domain.com smtp=smtp.domain.com set smtp-auth-user=username smtp-auth-passwor ...

  7. oracle 结构化语言查询 DML DDL DCL

    --结构化查询语言 (Structured Query Language),具有定义. --查询.更新和控制等多种功能,是关系数据库的标准语言. --SQL分类: -- 数据操纵语言DML Data ...

  8. secureCRT7.3.4的破解与安装

    1-9为 SecureCRT 7.3.4 安装图解:10-13是 SecureCRT 7.3.4 破解图解,心急的朋友可以直接向下拉. 以下是百度百科对 SecureCRT 的介绍: SecureCR ...

  9. Pandas面板(Panel)

    面板(Panel)是3D容器的数据.面板数据一词来源于计量经济学,部分源于名称:Pandas - pan(el)-da(ta)-s. 3轴(axis)这个名称旨在给出描述涉及面板数据的操作的一些语义. ...

  10. Delphi_时间间隔

    1. var dtOnlineDateTime, dt: TDateTime; begin dt := StrToDateTime('2017/6/28 16:41:30'); dtOnlineDat ...