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

在运用标准标签库和EL表达式写JSP页面的时候,有时候会报500错误

执行某jsp页面时,弹出如标题所示异常,jsp代码如下:

<%@ page language="java" contentType="text/html;charset=gbk" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
  </head>
  
  <body>
    This is the result:
    <c:out value="${userInfo}" default="没有结果"/>
  </body>
</html>

异常的原因是不能识别“${userInfo}”,解决办法有两种:
一、在page指令里,加入isELIgnored="true"属性,即
<%@ page language="java" contentType="text/html;charset=gbk"  isELIgnored="true" %>
二、把<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>变为:
<%@ taglib prefix="c" uri=http://java.sun.com/jstl/core_rt  %>
经过改动之后,jsp页面能正常执行了。

时间: 2024-08-06 03:18:07

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 items does not accep t any expressions

According to TLD or attribute directive in tag file, attribute items does not accep t any expressions 严重: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /selectorTagtest.jsp(26,8) According to TLD or attribute di

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

3天硬是是把这个问题解决了 有时候突然上个厕所灵感就来了 第一次向用JSTL解析xml 然后我想遍历整个xml文档打印出来 居然不让我输入变量 那让我怎么办啊 在网上各种找答案 说什么<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>变为:<%@ taglib prefix="c" uri=http://java.sun.com/jstl/core_rt  %

关于According to TLD or attribute directive in tag file, attribute value does not accept any expressions异常

在做项目时遇到了这个异常,网上一查才知道 JSTL core库的版本问题. 当我们在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> 时 我们在jsp才用&

jstl 中无法使用EL语句。异常信息:According to TLD or attribute directive in tag file, attribute value does not accept any expressions

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"%>

According to TLD or attribute directive in tag file, attribute value does not accept any expressions报错解决办法

1.出现原因: 导入的uri由于不是正确的导致这个jstl不支持el的表达式 jstl uri导入错误:  1 <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> 不支持el表达式 修改方法 将其改为  1 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

jsp 标签 According to TLD or attribute directive in tag file.错误

在确保jar包已经添加的情况下 把<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> 改为: <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> 就可以了

textcolor 设置selecter 报错: &lt;item&gt; tag requires a &#39;color&#39; attribute or child tag defining a drawab

如果是textview的textcolor属性设置成selecter,则需要这么写这个selecter: <span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <i

EL表达式错误attribute items does not accept any expressions

解决方法是将 <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%> 改成 <%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>

jstl引入报错

jstl1.0的引入方式为: <taglib uri="http://java.sun.com/jstl/core" prefix="c" /> jstl1.1的引入方式为: <taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" /> 注意:在jstl1.1版本的jar包中,既包含1.0版本的tld文件,又包含1.1版本的tld文件.所以在