• 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

Difference between %include file=""% and jsp:include file=""

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can any one tell me difference between <%include file=""%> and <jsp:include file=""> and which one is faster?
 
Ranch Hand
Posts: 335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have file index.jsp,

<%@ include file="header.html" %>
This is index page
<jsp:include page="footer.jsp" />

content of header.html file is copied to inclduing page at translation time.

With <jsp:include page="footer.jsp" /> will include content of footer.jsp at request time.

When first jsp is translated to servlet java class in case of directive it includes file content (at translation time contents are included).

With jsp:include a runtime call is included to footer.jsp so when user requests index.jsp at that time footer.jsp contents will be included (at request time) and response will be sent to client.

For more information please read some book or do google.
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Refer here to point number 11...http://faq.javaranch.com/view?ScwcdHints
 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can refer to the David Bridgewater's book..chapter 7...for some good graphical explanation...
 
reply
    Bookmark Topic Watch Topic
  • New Topic