在使用jstl时,这个异常咋回事?According to TLD or attribute directive in tag file, attribute value
我在用tomcat5.0+jstl中,使用标准标签库时,本来可以正常运行,但不知怎的却报出了
这样的异常:
HTTP Status 500 -
-----------------------------------------------------------------------------
---
type Exception report
message
description The server encountered an internal error () that prevented it from
fulfilling this request.
exception
org.apache.jasper.JasperException: /c_out.jsp(33,0) According to TLD or
attribute directive in tag file, attribute value does not accept any
expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError
(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch
(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError
(ErrorDispatcher.java:186)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes
(Validator.java:984)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit
(Validator.java:739)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1458)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2176)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2226)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2232)
org.apache.jasper.compiler.Node$Root.accept(Node.java:485)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2176)
org.apache.jasper.compiler.Validator.validate(Validator.java:1515)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:253)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:459)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
org.apache.jasper.JspCompilationContext.compile
(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service
(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile
(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
-----------------------------------------------------------------------------
---
Apache Tomcat/5.0.14
代码是这样写的:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@page isELIgnored="false"%>
<html>
<head>
<title>JSTL: c:out的使用</title>
</head>
<body bgcolor="#FFFFFF">
<hr>
<% session.setAttribute("test_session","testValue_session");%>
<% request.setAttribute("test_request","testValue_request");%>
<% application.setAttribute("test_application","testValue_application");%>
<% request.setAttribute("test_all","testValue_request");%>
<% session.setAttribute("test_all","testValue_session");%>
<% application.setAttribute("test_all","testValue_application");%>
<hr>输出一个字符串:
<c:out value="test"/>
<hr>带有body的c:out标签,但是body不输到客户端。
<% for(int i=0;i<5;i++)
{
%>
<c:out value="test2">
<% out.println("i");
i++;
%>
</c:out>
<% }%>
<hr>
<c:out value="2<10" escapeXml="true">
</c:out>
<hr>获得session中的属性:
<c:out value="${test_session}"/>
<hr>获得request中的属性:
<c:out value="${test_request}"/>
<hr>获得application中的属性:
<c:out value="${test_application}"/>
<hr>测试表达式语言优先获得哪个属性:<request,session,application>
<c:out value="${test_all}"/>
<hr>输出一个默认值:
<c:out value="${notex}" default="这个值不存在"/>
</body>
</html>
并且我也已正确将jstl.jar拷贝到了WEB-INF\lib中。
这个异常:According to TLD or attribute directive in tag file, attribute value
does not accept any expressions
如何解决呀?我从装了tomcat5.0也不行!