Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Static include vs Dynamic include in JSP  RSS feed

 
Sunil Pradhan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need a clarification on the difference in adding a file with page directives and adding a file with jsp:include action tag.I am aware of the fact that jsp:include adds file in runtime where as the page directive adds it in translation time.But what else is the difference and real time situations that may influence us to choose beteween the two.

----------
Sunil..


 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use jsp:include to include sub-titles in your page at runtime using request params.
 
vidhyasagar reddy
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for e.g if the file name is retrived at runtime using
<%=...%>
u can't use this in directive include
but can in jsp:include

got it
 
Sunil Pradhan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Vishnu and Vidyasagar for a quick and clear response.

Thanks again,

Cheers,
---------
Sunil..
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For more information, there is an entry in the JSP FAQ covering this subject:
http://faq.javaranch.com/view?IncludesActionDirective
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ben,
superb article.it cleared my confusion.
cheers,
babu.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!