• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about directive

 
jeffrey z. lee
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!
 
Parag K
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
 
Paul McKenna
Ugly Redneck
Ranch Hand
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic