This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

include directive

 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is that true that if a JSP page is included in another JSP page by using include directive, then the included JSP page's syntax will be combined with the enclosing JSP's syntax and translated to a page implemention class?
please clearify.
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my first post to this wonderful site. I think I can help here....
There are two things: include action and include directive. With include action the output of the included page is included. I.e. the included page should be syntactically valid. But with include directive, the source of included page is included in the current page. So the resulting source should be valid.
Directive: <!@include file=copyright.jsp/> : Static
Action <jsp:include page=copyright.jsp/> : dynamic
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More like:
Directive: <%@ include file="copyright.jsp"%>
Action <jsp:include page="copyright.jsp" flush="true"/>
The first one is not an XML element, BTW...
 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx Jim,
but i think for both includes, the included JSP should have correct syntax.
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for correcting it, Tony.
Ernest, the source has to be of correct syntax in both the cases, however, in case of directive, the source of the included page is NOT compiled/translated seperately. For example, if the included page is using a variable 'i', 'i' does not have to be declared in that page. It can as well be declared in the main page.
 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gd pt. Thx alot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic