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 JSP and the fly likes Servlet Creation 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 » Java » JSP
Bookmark "Servlet Creation" Watch "Servlet Creation" New topic

Servlet Creation

Malhar Barai
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
Hi all,
How many servlets are created on compilation when we use :
1. Static Include
2. Dynamic Include ??
I think for (1), only 1 servlet is created as the content of the included file is inserted in the JSP.
But for (2), I am really confused.

Malhar Barai
SOA & Java Book
Chandra Bairi
Ranch Hand

Joined: Sep 12, 2003
Posts: 152
In static include what happens is the code from the file is directly included in the page and as a result only one servlet is generated.

In the case of the dynamic include the servlet which has to be included is loaded dynamically when the code from the particular jsp page has to be included and hence two servlets are created.
hope this helps and incase i am wrong please let me know.

Malhar Barai
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
Can there be more that one dynamic includes..and in that case more that 2 servlets will b generated ??
aw thnx shekar
I agree. Here's the link:
subject: Servlet Creation
Similar Threads
jsp:include standard action
JSP in class diagram (part 2)
RequestDispatcher doubts
Servlet Context