Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Help Java I Include directive vs Include Action

Related Tutorials


 
 

Share on Google+Share on Google+

Include directive vs Include Action

Advertisement
Include directive (<%@ include %>) includes file into the JSP page at compile time.

Include directive vs Include Action

     

Include directive: Include directive (<%@ include %>) includes file into the JSP page at compile time. Include directive should be used if the included code is in the same page.

Include Action: Includes action (<jsp:include>) includes the output at runtime. Include action (runtime include) runs a bit slower yet it is preferred generally because it save a lot of memory of the system. 

E.g: Suppose there are two pages welcome.jsp and index.jsp and welcome.jsp includes index.jsp, index.jsp is invoked only when welcome.jsp executes, and the output of index.jsp is inserted into the output stream of welcome.jsp. 

For example, if you want to use an include having a set of tag libraries with the taglib directive, you should use a compile-time include. If you wish to insert a standard header and footer in your page, include action will be more efficient.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 11, 2009

Related Tutorials

Discuss: Include directive vs Include Action  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:2
Rangaiah srirama
December 12, 2011
gud explanation

excellent
y.satish
March 25, 2013
voice xml,java

i want voice xml,java Tutorials
DMCA.com