You can't. Not with the EL. If your aim is to write scriptless JSP pages, then calling general instance methods on an object is a no go. In the scriptless scenario it is expected that any such computations would have happened in the controller prior to the JSP gaining control, or can be handled via custom actions (tags) where you can "pass" data as attributes. [ July 28, 2005: Message edited by: Bear Bibeault ]
Joined: Jul 27, 2005
Got it. Now I have a bean and I am getting the values from it using EL to dipalay on the page. One of the getters accepts an int. How can I invoke that getter method?
What it comes down to is that any value objects that you are going to use as scoped variables should strictly follow the JavaBean standard. Methods that accept parameters (outside of property mutators), constructors that take parameters, and the like are useless from the point of view of the EL.
Start thinking in terms of making the objects that you pass to your JSP page follow the JavaBeans conventions and your life will instantly become much simpler and better.
It's an easy matter to make the data EL-friendly on the Java side of the equation. Contorting on the page to try and accomodate non-standard structures will only lead to angst. [ July 29, 2005: Message edited by: Bear Bibeault ]