• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP - JSP communication using jsp:include

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My project is purely component based and hence can be broken up into small pieces. As a result of which even the home page, template.jsp is a collection of include directives. The issue here is that the components being displayed on the page need to be made dynamic instead of hard coding everything. For eg, I include four files in my template.jsp called something.inc etc etc. One of the files is content.inc which is responsible for getting the correct jsp files to be displayed on the basis of the user request. Now I need to pass a parameter from template.jsp that carries the name of the file to be displayed and then access that parameter in content.inc. I tried using <@ include file = > directive, but even though the string containing then name of the file goes to content.inc, the directive requires the file name to be quoted. Can anyine suggest a workaround to this...? Cos even the <jsp:include page = /> tag is not working with this particular problem. All the *.inc files have jsp content in them, so no issues about that part.This is just a question of a jsp - jsp comm andI think I'm making a fundamental mistake somewhere. Plz advice at the earliest.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look in the JSP FAQ. The link is at the top of this JSP forum.

JspFaq

Look at the include action in this part:
The difference between the Include Directive and the Include Action.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic