Keith Flo wrote:Dan,
No .. it doesn't look correct ... a couple questions ...
1. What does MovieListing.getList() return? a java.util.ArrayList of Strings, a java.util.ArrayList of MovieBeans or something else?
2. It looks like your JSP code places an ArrayList of MovieBean into scope and the toString() method of MovieBean prints what you want when you iterate using forEach. Is this what you want?
3. What do you want the Java code to do?
Bear Bibeault wrote:This has nothing to do with the JSTL -- this is an EL question.
And the answer is that the EL can't call general methods by design -- it is intended to work only with bean properties. Method calls with parameters are not valid bean properties and hence cannot be invoked.
Beans should be designed as beans, and not be general classes masquerading as beans.
If you really need to call a general method, you can explore defining custom tags or EL functions.