This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dynamically including JSP's

 
sandy bol
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to include JSP dynamically by using include directive
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65110
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll need to be clearer than that.
 
Kathiresan Chinnasamy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Actually include directives happens at translate time

but if you want include page at runtime use standard action

syntax for standard action :

<jsp:include page = "Header.jsp" />

notes:
The above syntax include the Header.jsp at run time
 
Soniya Ahuja
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can also use <c:import url="" [context=""]> JSTL tag, but you'll need to have to import the core library using taglib directive and you need jstl.jar.

It's more flexible than jsp:include because you can include anything from outside your app as well by specifying the URL.

USing context you can get a page from another app on the same server. See specs for more details
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65110
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is all assuming that by "dynamic", the poster meant "at run time". The question still needs to be clarified.

Please put a little more effort into asking your questions.
 
sandy bol
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Kathiresan Chinnasamy your suggestion is worked out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic