wood burning stoves 2.0*
The moose likes Struts and the fly likes iterate Struts Tag Help Needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iterate Struts Tag Help Needed" Watch "iterate Struts Tag Help Needed" New topic
Author

iterate Struts Tag Help Needed

Abdul Kader
Ranch Hand

Joined: Apr 11, 2007
Posts: 115
Hi Guys,

I have a JSP page, where i have display a report. the Reports has more column and data. So when I tried of displaying, I got a exception stating that the code is too long to compile. So I spited the pages into two. However I am using JSP action include including the child page in the parent page.

I am using struts iterate tag to iterate. I really don't know how I can pass the Nth
Object ever time to the child page. Here I am don�t know how take the n object from the current iterate in the parent page, then how can I sent that as an object to the action include JSP page (Child page).

I really appreciate for your help.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The logic:iterate tag places the bean exposed by each iteration in page scope. Normally this is fine as you generally use the bean within the same page. In your case, though, you'd want to put the bean in a wider scope such as request so that you can use it in a different page. You can do this with the bean:define tag. Here's an example:

In this example, the "other.jsp" can retrieve "requestScopedBean" from request scope and use it to display values.
[ June 26, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Abdul Kader
Ranch Hand

Joined: Apr 11, 2007
Posts: 115
Thanks a Lot Merrill, It really helped me to solve the issue.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: iterate Struts Tag Help Needed