Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSPX EL 2.2 method calling using EL 2.1

Tags:

el

jspx

I have JSP that works fine in Tomcat 7 but does not work in Tomcat 6 which I assume is the fact that you cannot call methods (other than getters/setter) from EL 2.1.

The method I need to call cannot be named as a getter.

like image 424
Adam Gent Avatar asked Jan 23 '26 03:01

Adam Gent


1 Answers

I figured out a workaround and thought I would post the answer:

If you have Spring installed you can use Spring EL so that you can call methods on objects

For example:

<spring:eval expression="pic.thumbnailUrl()" var="thumbnail" />
like image 80
Adam Gent Avatar answered Jan 25 '26 15:01

Adam Gent