> I don't think that we need to use dynamic include everywhere. Most of the
> times
> we should try to use the static include only for the performance
> reasons as
> that block or file is included at the compilation time only and JSP engine
> does
> not have to include the block at the request time. If the resource is
> dynamic,
> dynamice include acts on a request and sends back a result that
> is included
> in
> the JSP page and then only JSP container resumes the processing of JSP
> page.

Did you try this out?
I'm not sure that dynamic includes are slower. In fact they might even be
faster than static includes.
The web container doesn't do a real http request to itself for every dynamic
include! It can optimize the chain of servlets a request goes through. All
the overhead of starting a thread, accepting and parsing the http commands
and parameters, all the network stuff is only done once. The only extra
thing involved in a dynamic include is a function call to the service method
of a servlet.
Static includes OTOH are linked in at compile time. This means that the same
lines of code (HTML of java) are copied in every generated servlet that uses
the include. Since a servlet instance remains in memory, it also means that
your include code is kept x times in memory.
Lets give the example of a footer.jsp with some address info and stuff. It's
normal that you include that in every page. This could mean that the address
information is kept in Ram memory maybe 200 times. I really think that could
harm performance.

Geert Van Damme

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to