Jasper in Jetty 6 throws exception for JSTL tag

I am trying to run an application in a dock that works fine in Tomcat 5.5. The application uses servlet 2.4 and JSP 2.0.

Jetty / Jasper throws this exception:

org.apache.jasper.JasperException: /WEB-INF/tiles/layout/main.jsp(85,55) PWC6340: According to the TLD, rtexprvalue is true, and deferred-value is specified for the attribute items of the tag handler org.apache.taglibs.standard.tag.rt.core.ForTokensTag, but the argument for the setter method is not a java.lang.Object 

One strange thing, I can't find TLD anywhere. It seems that I get it by magic, which I do not understand. Is it possible to get the wrong TLD?

It's also hard to tell where it came from org.apache.taglibs.standard.tag.rt.core.ForTokensTag. Eclipse does not find it in the project download path.

Any hints are welcome ...

+6
jstl jetty
source share
2 answers

Jetty includes its own JSTL library, and there is no need to include the standard jakrta taglib and kernel shortcuts.

If you put jakartat taglib jars in your web application, then there is a conflict in the forTokens tag, which causes this error, while other tags work well. I suggest either removing the jakarta taglib implementation from your web application, either relying on Jetty, or stop using forTokens.

+6
source share

@Guss is correct, the only way out seems to be to avoid using c:forTokens .

alternative c:forTokens with c:forEach :

 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <c:forTokens items="${input}" delims="," var="i"> <!-- do stuff with ${i} --> </c:forTokens> <c:forEach items="${fn:split(input,',')}" var="i"> <!-- do stuff with ${i} --> </c:forEach> 
+4
source share

All Articles