This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question about directive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question about directive" Watch "question about directive" New topic
Author

question about directive

jeffrey z. lee
Ranch Hand

Joined: Mar 21, 2002
Posts: 40
I don't know how to use <%@ include file="...." %> in actual program, would seniors like to give simple a example? thanks a lot!


jeffrey z. lee
Parag K
Greenhorn

Joined: Sep 17, 2002
Posts: 4
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

Joined: Jul 08, 2000
Posts: 1006
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


Commentary From the Sidelines of history
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: question about directive