Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iterate Struts Tag Help Needed

 
Abdul Kader
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Abdul Kader
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Lot Merrill, It really helped me to solve the issue.

 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic