• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

include directive

 
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.
 
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
 
Desperado
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.
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic