This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP - JSP communication using jsp:include  RSS feed

 
Abhishek Dwaraki
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • 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.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!