• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Suggestion on templated page

 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic