Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

which include to use page or file

 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • 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
 
Trish Wu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for your reply and to directing me to the other forum question on the includes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic