aspose file tools*
The moose likes JSP and the fly likes dynamically including JSP's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "dynamically including JSP Watch "dynamically including JSP New topic
Author

dynamically including JSP's

sandy bol
Greenhorn

Joined: Jul 16, 2008
Posts: 11
how to include JSP dynamically by using include directive
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

You'll need to be clearer than that.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kathiresan Chinnasamy
Ranch Hand

Joined: Jan 01, 2008
Posts: 65
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

Joined: Jul 20, 2008
Posts: 83
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


SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD
http://soniyaahuja.webs.com
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

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

Joined: Jul 16, 2008
Posts: 11
thanks Kathiresan Chinnasamy your suggestion is worked out
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: dynamically including JSP's