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

Suggestion on templated page

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a search page which only had forms... I can include this page on any part of my JSP as I please because it doesn't generate any dynamic contenet. However, now I realized that I need to include dynamic content... For example, I need a html:select tag that would be poppulated based on the records on the database... But to do this, I need to come from the controller which would render my template, un-reusable in other parts of my page... I've thougt of different solutions, mainly...

1. Type all the option tags manually.
2. AJAX?
3. Maybe <jsp:include page="/actions/someactions.do"/> would work?
4. Maybe Struts has other alternatives to this problem...

I'm sure many of you have experienced this... I'm trying to remain as model 2 as possible... Thanks!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I vote for option 3. By having a jsp:include call a Struts action, you can populate the bean containing the list of options and then display the JSP fragment as part of a larger page.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Merrill. Thanks for your suggestion... But the page I'm trying to include won't get displayed... I even tried taking out all the Struts tags and just insert a plain text... But nothing would appear excep the page which is trying to include the template... Here's how I inlcude my page...

index.jsp



Here's the page I'm trying to include...



thanks for you help...
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... After clearing all my cookies and offline contents... I found out that the page really just forwards to my included page and not really include it... OMG!!!
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure the forward for your action does not specify redirect="true". It sounds like this may be what's happening.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic