According to TLD or attribute directive in tag file, attribute items does not accep t any expressions
- Critical: Servlet.service () for Servlet JSP threw exception
- Org.apache.jasper.JasperException:/selectortagtest.jsp (26,8) according to TLD or attribute directive in tag file, attrib Ute items does not accep
- T any expressions
- At Org.apache.jasper.compiler.DefaultErrorHandler.jspError (defaulterrorhandler.java:40)
- At Org.apache.jasper.compiler.ErrorDispatcher.dispatch (errordispatcher.java:407)
- At Org.apache.jasper.compiler.ErrorDispatcher.jspError (errordispatcher.java:148)
- At Org.apache.jasper.compiler.validator$validatevisitor.checkxmlattributes (validator.java:1172)
- At Org.apache.jasper.compiler.validator$validatevisitor.visit (validator.java:819)
- At Org.apache.jasper.compiler.node$customtag.accept (node.java:1512)
- At Org.apache.jasper.compiler.node$nodes.visit (node.java:2343)
- At Org.apache.jasper.compiler.node$visitor.visitbody (node.java:2393)
- At Org.apache.jasper.compiler.node$visitor.visit (node.java:2399)
- At Org.apache.jasper.compiler.node$root.accept (node.java:489)
- At Org.apache.jasper.compiler.node$nodes.visit (node.java:2343)
- At Org.apache.jasper.compiler.Validator.validate (validator.java:1737)
- At Org.apache.jasper.compiler.Compiler.generateJava (compiler.java:165)
- At Org.apache.jasper.compiler.Compiler.compile (compiler.java:314)
- At Org.apache.jasper.compiler.Compiler.compile (compiler.java:294)
- At Org.apache.jasper.compiler.Compiler.compile (compiler.java:281)
- At Org.apache.jasper.JspCompilationContext.compile (jspcompilationcontext.java:566)
- At Org.apache.jasper.servlet.JspServletWrapper.service (jspservletwrapper.java:317)
- At Org.apache.jasper.servlet.JspServlet.serviceJspFile (jspservlet.java:337)
- At Org.apache.jasper.servlet.JspServlet.service (jspservlet.java:266)
- At Javax.servlet.http.HttpServlet.service (httpservlet.java:803)
- At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:290)
- At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206)
- At Org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (characterencodingfilter.java:96)
- At Org.springframework.web.filter.OncePerRequestFilter.doFilter (onceperrequestfilter.java:75)
- At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:235)
- At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206)
- At Org.apache.struts2.dispatcher.FilterDispatcher.doFilter (filterdispatcher.java:413)
- At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:235)
- At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:206)
- At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:233)
- At Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:175)
- At Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:128)
- At Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:102)
- At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:109)
- At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:286)
- At Org.apache.coyote.http11.Http11Processor.process (http11processor.java:844)
- At Org.apache.coyote.http11.http11protocol$http11connectionhandler.process (http11protocol.java:583)
- At Org.apache.tomcat.util.net.jioendpoint$worker.run (jioendpoint.java:447)
- At Java.lang.Thread.run (thread.java:595)
Workaround:
Put
<%@ taglib uri= "Http://java.sun.com/jstl/core" prefix= "C"%>
Switch
<%@ taglib uri= "Http://java.sun.com/jsp/jstl/core" prefix= "C"%>
Another very thorough analysis is as follows:
Environment: Win2003 Tomcat 5.5 JDK1.6 on
<?xml version= "1.0" encoding= "UTF-8"?>
<web-app version= "2.4"
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" >
</web-app>
JSP Code:
<% @taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%>
1+2+3 = ${1+2+3} <br>
1+2+3 = <c:out value= "6"/> <br>
There is no problem with execution at this time.
1+2+3 = <c:out value= "${1+2+3}" occurs when/> executes:
According to TLD or attribute directive in tag file, attribute value does no accept any expressions
There was a JSP missing yesterday, so there was always a problem.
Code
<% @taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%>
Written
<% @taglib prefix= "C" uri= "Http://java.sun.com/jstl/core"%>
Try again today. Discover JSTL1.1 can be used. But when using JSTL1.0, there is a problem.
is to put the JSTL1.1 library under the/web-inf/lib/.
At first I was a copy of the Jstl library in NetBeans 5.5.1 and found it to work. Later with the jstl1.1.2 library, can also be used.
Summarize:
JSTL1.1 's library is used in JSP2.0 (Servlet 2.4) and later (recommended with JSTL1.1 and above):
Code
<% @taglib prefix= "C" uri= "Http://java.sun.com/jsp/jstl/core"%>
Xml
<?xml version= "1.0" encoding= "UTF-8"?>
<web-app version= "2.4"
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" >
</web-app>
In Servlet2.3 and before,
Code
<% @taglib prefix= "C" uri= "Http://java.sun.com/jstl/core"%>
Less JSP than version 2.4
Xml
<?xml version= "1.0" encoding= "UTF-8"?>
<! 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>
In Servlet2.3 the best use JSTL1.0, if use JSTL1.1, please add
<?xml version= "1.0" encoding= "UTF-8"?>
<! 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>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>
</web-app>
Copy the C.tld under the TLD directory to/web-inf.
Find the official:
Http://jakarta.apache.org/site/downloads/downloads_taglibs.html
Select Standard 1.0 Taglib and standard 1.1 Taglib to download jstl1.0 and jstl1.1 versions.
According to TLD or attribute directive on tag file, attribute page does not accept any expressions
The property that corresponds to tag does not support expression passing in. The workaround is to add the Rtexprvalue attribute to the corresponding tag in the TLD file and set it to true, for example:
<tag>
<name>CustomTag</name>
......
<attribute>
<name>AttName</name>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
The internet says this has something to do with the Tomcat version (5.x), and I'm using 5.0.27, but this has not been confirmed.
JSP exception occurs when the application deployment is running, when using the JSTL library: According to TLD or attribute directive in tag file, attribute value does no accept any expressions, perhaps because of the use of the JSP2.0 version, while not using the backup version of the JSTL Core library (RT library), there are two ways to handle this:
1. Modify Web. Xml.
<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" >
Change to version 2.3
<! 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. Using the JSTL Core RT Library
There are two taglib pseudo-directives for the JSTL Core library, where the RT library is dependent on the property value of the JSP's traditional request, rather than relying on El to implement it (called the El Library. JSP2.0 will support EL)
JSP in the use of <%@ taglib uri=http://java.sun.com/jstl/core prefix= "C"%> in the 2.3 version can be, in 2.4, is not the version is incompatible?
As long as the
<%@ taglib uri= "Http://java.sun.com/jstl/core" prefix= "C"%>
Switch
<%@ taglib uri=http://java.sun.com/jstl/core_rt prefix= "C"%>
There's no problem.
Reprinted from: http://www.cnblogs.com/fish-king/archive/2013/01/16/2862686.html
JSP exception Org.apache.jasper.JasperException (RPM)