Difference between <%@include%> and <jsp:include>

Thread Solved
Reply

Join Date: Mar 2006
Posts: 37
Reputation: sree22_happy is an unknown quantity at this point 
Solved Threads: 1
sree22_happy's Avatar
sree22_happy sree22_happy is offline Offline
Light Poster

Difference between <%@include%> and <jsp:include>

 
0
  #1
Jan 22nd, 2008
Hi friends
Can anyone tell me about the difference between <%@include file="abc.jsp" %> and <jsp:include file="abc.jsp"/>
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,581
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 461
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: Difference between <%@include%> and <jsp:include>

 
1
  #2
Jan 27th, 2008
Think of the include directive as a header file of languages like C/C++. When using the include directive, the combined contents of the original JSP page and all its included resources are translated into the same implementation servlet i.e. the contents of the included resource is copy pasted before translation to a servlet. The important thing here is that all this happens during translation time and only static content is supported.

The include action <jsp:include> is almost similar to the include directive except for a few subtle differences. The include action is executed at request time as opposed to translation time. Thus instead of the content of the include file being included in the calling JSP, the output of the JSP is included or passed to the JSPWriter of the calling page. This allows us to include both static and dynamic content into the JSP page. Using the jsp action also allows you to explicitly pass parameters to the included page.
  1. <jsp:include page="/index.jsp">
  2. <jsp:param name="name" value="sos" />
  3. </jsp:include>
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 37
Reputation: sree22_happy is an unknown quantity at this point 
Solved Threads: 1
sree22_happy's Avatar
sree22_happy sree22_happy is offline Offline
Light Poster

Re: Difference between <%@include%> and <jsp:include>

 
0
  #3
Jan 30th, 2008
thanks for the answer !
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC