1

we have a web application which now needs to call methods from jsp files. We previously used Tomcat6, so we took the following steps

  • migrate to Tomcat 7
  • declare Servlet version 3 in web.xml
  • expose the bean in our servlet.xml

Now, accessing objects with getters and setters via {$bean.object} works fine, but method invocation via {$bean.method} throws the following error

org.apache.jasper.JasperException: /WEB-INF/jsp/home.jspx (line: 15, column: 52) "${bean.method()}" contains invalid expression(s): de.odysseus.el.tree.TreeBuilderException: Error parsing '${bean.method()}': syntax error at position 29, encountered '(', expected '}'

I read about other people having similiar issues (for example here).

While the project depends on a multitude of external libraries, none of the metnioned servletcontainer-specific ones is in the /WEB-INF/lib folder.

My questions are:

  • How can I determine if a library is specific to an older version of Tomcat?
  • Is there any other possible source for this error?
Community
  • 1
  • 1
mkiesner
  • 635
  • 5
  • 20

2 Answers2

0

We used an old version of shindig which itself uses JUEL 2.1.x and thus did not support EL 2.2; updating to a new shindig version should resolve the issue, since it supports the JSP 2.2 specification.

mkiesner
  • 635
  • 5
  • 20
0

Based on the class listed in the error, the web application has a dependency on JUEL.

The expression you are using includes a method invocation. Method invocation was added in EL 2.2 (JavaEE 6). JUEL claims to support EL 2.2 so it looks like you have an old version of JUEL bundled with your web application.

One solution is to update that dependency.

A second solution is to drop JUEL entirely. Tomcat 7 includes an EL 2.2 implementation and the EL discovery mechanism means that whatever is using EL should just find Tomcat's implementation if it can't find JUEL.

Finally, I'd note that EL has moved on significantly in EL 3.0 (JavaEE 7) and that there is no obvious signs of JUEL implementing EL 3.0 whereas a EL 3.0 implementation has been available in Tomcat 8 and other containers for some time. I'd suggest asking the JUEL developer about plans for EL 3.0 and carefully considering the continued use of JUEL based on their response.

Mark Thomas
  • 16,339
  • 1
  • 39
  • 60