"Craig R. McClanahan" wrote:
> [...]
> By the way, on the topic of server-side includes, Luc correctly pointed out that
> you can do includes the "JSP way" with no extra software.  However, because you
> can run any servlets (not just ones you write), you could easily add a servlet
> that supports the <servlet> style includes, or "*.shtml" files.  There are several
> open source packages of servlets like this -- for that matter, writing a
> server-side-include servlet yourself should certainly be within your grasp by the
> time you finish your studies.

Craig, your answers to this and other list are always to the point and very
helpful, but here I believe you're a bit misleading. As far as I know there's
no way to write a stand-alone servlet that handles the <servlet> style include.

The reason is that the Servlet API doesn't provide any method to get access
to a servlet using just the defined name or class name, now when getServlet
is deprecated. And the getNamedDispatcher method suggested for 2.2 doesn't
provide any parameters for class name and parameter values specified by <param>
tags in its current form, so it will not help either.

So in order to write a stand-alone SSI servlet you have to duplicate all
servlet engine logic for locating and loading servlets and maintain their
life cycle. You will also have to use your own class loader (or use the
primordial class loader) as opposed to the one used by the engine for other
servlets, so there's also a risk for ClassCastExceptions and similar problems.

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to