This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes Error Occurred When Using JSP Expression Inside Struts c:forEach Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error Occurred When Using JSP Expression Inside Struts c:forEach Tag" Watch "Error Occurred When Using JSP Expression Inside Struts c:forEach Tag" New topic
Author

Error Occurred When Using JSP Expression Inside Struts c:forEach Tag

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I am using the Struts framework. I have a JSP where a collection of JavaBeans are received in a request scope.

Each of the JavaBeans, which I name it as ThreadBean, has a number of properties. In the beginning of my JSP and right after the <%@ page import="org.MyOrg.MyProj.message.ThreadBean" %>, I have


I iterate through the collection using the <c:forEach ....> tag:


I have an expression in the <c:forEach .... >; tag. In that expression, I am calling the 'filter' method of another class SiteUtil.java (this class is also imported to my JSP). I have to pass one of the properties of the ThreadBean as a parameter to that 'filter' method; i.e. threadBean.getPostTopic(). And it is an error. My JSP cannot be compiled because of it.

What is the correct way of doing it?

[ June 15, 2004: Message edited by: JiaPei Jen ]
[ June 15, 2004: Message edited by: JiaPei Jen ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

My guess: eliminate the bean:define tag(s)


A good workman is known by his tools.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I have tried without the <bean efine ........> tag. I got the same error messages. Therefore, it is something else that caused the problem.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Error Occurred When Using JSP Expression Inside Struts c:forEach Tag
 
jQuery in Action, 3rd edition