• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

which include to use page or file

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the below is better to use on a web site.
I would have 3 includes on each page,- and would be the same for each page. ie. a header, footer, and left nav.
<%@ include file="this.jsp"%>
<jsp:include page="that.jsp" flush="true"/>
Is the below correct?
<jsp:include /> tag which is processed at runtime,
and <%@ include %> tag which is prcessed at compile time...
when is it better to use one or the other??
Thanks
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are only including the header, footer and navigation bar which are only static content. I would say to use static inclusion.
Just remember the rules that there are more dependencies if u share variables among the pages (i.e. they cant be compiled individually, only if u make use of pageContext to share variables). Also it is only suitable for parts which do not change very often.
Another pointer
Other discussion
 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply and to directing me to the other forum question on the includes.
 
Uh oh, we're definitely being carded. Here, show him this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic