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

difference between tages jsp:include and jsp:directive.include  RSS feed

 
Jim Baker
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI
Can anyone tell the difference between
the standard action: <jsp:include {attributes}/>
and
the directive: <jsp irective.include {attributes}/>(I did not see it in JSPv1.2 spec)?
Thanks
JB

ps:
Disabled the smiles on this post.
- madhav
[ April 27, 2002: Message edited by: Madhav Lakkapragada ]
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the <jsp:include > tag is used to include other jsp/servlet output at runtime. ie.: when the jsp page is accessed every time.
the <%@include> or jsp directive as u call it is used to include the jsp/servlet output at compilation time - meaning only once.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JB:
FYI....I deleted your other two (exactly same) posts.
Thanks.
- madhav
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Roy Ben Ami:
the <jsp:include > tag is used to include other jsp/servlet output at runtime. ie.: when the jsp page is accessed every time..

Yup! -- and realize this method includes only the output of the included JSP. The included JSP/Servlet is a full JSP that could be run on its own.
Originally posted by Roy Ben Ami:

the <%@include> or jsp directive as u call it is used to include the jsp/servlet output at compilation time - meaning only once.

-- and realize with this one -- what you're really doing is adding this JSP fragment to the code of your current JSP. There are some rules with this -- mostly you can't redefine some of the <%@ page directives. Quite often these are only fragments of a JSP (like a header or footer).
[ April 27, 2002: Message edited by: Jessica Sant ]
 
Maha Annadurai
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another difference between the action <jsp:include page=.../> and directive <%@ include file=....%> is , action can take a servlet value for its "page" attribute while the directive can not accept a servet for its 'file' attribute.
Regards,
Maha Anna
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maha Annadurai Can u plz elaborate your point ,as i could not follow what it means when u say "jsp:include can take a servlet value for its "page" attribute" .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!