JSPX EL 2.2 method calling using EL 2.1

情到浓时终转凉″ 提交于 2019-12-07 13:14:11

问题


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.


回答1:


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" />


来源:https://stackoverflow.com/questions/6194164/jspx-el-2-2-method-calling-using-el-2-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!