File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issue in using <s:iterator /> within another <s:iterator />

 
camp jay
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm iterating object<HOUSE> list in JSP.



And in this HOUSE object I have another object<ROOMS> list. I need to iterate Room list within House list iterator and need to access HOUSE properties also within Room iterator.

i.e



Can you tell me how to access properties of two objects separately in inner iterator?
I guess there might be better approach to this.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't nest custom tags like that.

The correct course of action is to use the "var" attribute (or "id", depending on which version of Struts 2 you're using) to capture each object being iterated over in both loops.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic