• 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

question about directive

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how to use <%@ include file="...." %> in actual program, would seniors like to give simple a example? thanks a lot!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i hope this simple example helps:
code for test.jsp
Code for include.html

the actual output should show 3 lines with the middle line being the contents of the included file.
include directive will put the contents of the included file at the requested place, so if you include a jsp file using this directive, then it is the source code of the JSP that is included and not the output of the jsp page (if any)
HTH
Parag K
 
Ugly Redneck
Posts: 1006
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
A correction :
Including a JSP file using the directive will produce output. However the disadvantage is that if the included JSP file is modified one MAY have to update all the JSP's that include it as well.
SR
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic