This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question about directive" Watch "question about directive" New topic

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

Joined: Sep 17, 2002
Posts: 4
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)
Parag K
Paul McKenna
Ugly Redneck
Ranch Hand

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

Commentary From the Sidelines of history
I agree. Here's the link:
subject: question about directive
jQuery in Action, 3rd edition