Jasper / JSP precompilation problems with transition to Tomcat 7 - NumberFormatException: for input line

I have a working webapp running on Tomcat 5.5 that I am trying to connect to Tomcat 7. I had a problem trying to precompile some JSPs using Jasper2. I got: java.lang.NumberFormatException: for input line: "$ {startYear}"

I believe the problem is that this new version of Jasper (JSP 2.1 impl) is trying to dereference $ {startYear} during pre-compilation. In the old version, I see $ {startYear} in the generated Java file.

I am sure this is some configuration or class problem that I am missing, but I cannot find any good solution references. BTW - I can make it work by returning to the jasper jars that ship with 5.5, but I would rather not do it if I can avoid it.

thanks for any advice

+4
source share
2 answers

See that you have a flimsy JSTL 1.0 library in your webapp /WEB-INF/lib . EL expressions are calculated and evaluated differently. Delete both old JSTL 1.0 jstl.jar and standard.jar and place the new new JSTL 1.2 jstl-1.2.jar .

Remember to update the JSLL taglib URI in any JSP to include the new /jsp prefix that was introduced with JSTL 1.1. For instance.

 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
+1
source

BalusC's answer is one possible reason, but even with the correct JARs in the classpath, a problem can still occur. I found that web.xml also needs to be updated to a newer version of the servlet specification - 3.0 (for Tomcat 7) or 2.5 (for Tomcat 6).

See the JSTL tag information page for more information .

0
source

All Articles