GeeCON Prague 2014*
The moose likes Servlets and the fly likes include directive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "include directive" Watch "include directive" New topic
Author

include directive

shivani anand
Ranch Hand

Joined: Dec 28, 2000
Posts: 155
what is the use of include directive and how we can use it in JSP?
shivani
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
I am just begingin jsp and i read that this derictive is used to include other pages into this page. So you can use that pages functionality as well.


Val SCJP <BR>going for SCJD
Bharatesh H Kakamari
Ranch Hand

Joined: Nov 09, 2000
Posts: 198
If you know C language then the include directive is similar to #include directive there.
include directive is used to include a jsp file in the current jsp file. The reason why this could be done is to separate presentation layer into various jsp pages so that if a change is required for one page, the entire presentation layer need not change.
There are two ways of including a file : a) the include directive and another with <jsp:include> action. The latter is used when the design requires the inclusion of the file as run-time. For eg during run-time another jsp file gets generated and this is included at run-time.
HTH
 
Consider Paul's rocket mass heater.
 
subject: include directive