views:

903

answers:

2

I'm trying to run an application in jetty that runs fine in Tomcat 5.5. The app uses servlet 2.4 and JSP 2.0.

Jetty/Jasper is throwing 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 odd thing, I can't find the TLD anywhere. It seems to be obtaining it by magic that I don't understand. Is it possibly getting a wrong TLD?

It's also hard to tell from where it's loading org.apache.taglibs.standard.tag.rt.core.ForTokensTag. Eclipse doesn't find it in the load path of the project.

Any hints welcome ...

+2  A: 

Jetty includes their own JSTL library and there is no need to include jakrta taglib's standard and core jars.

If you do put jakartat taglib's jars into your web application then there is a conflict in the forTokens tag that causes this error while other tags work well. I suggest either remove the jakarta taglib implementation from your web app and rely on Jetty's, or stop using forTokens.

Guss
+1  A: 

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

example alternative to c:forTokens using c:forEach:

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%&gt;

<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>
Gareth Davis