Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess: eliminate the bean:define tag(s)
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried without the <bean efine ........> tag. I got the same error messages. Therefore, it is something else that caused the problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic