org.apache.cocoon.servlet
Class BootstrapServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.apache.cocoon.servlet.BootstrapServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class BootstrapServlet
extends javax.servlet.http.HttpServlet

A bootstrap servlet to allow Cocoon to run in servlet engines that aren't fully compliant with the servlet 2.2 spec.

This servlet adds a mandatory "context-dir" parameter to those accepted by CocoonServlet, which should point to Cocoon's context directory (e.g. "/path-to-webapp/cocoon"). This directory is used to :

Version:
CVS $Id: BootstrapServlet.java,v 1.2.2.2 2002/07/15 14:48:05 cziegeler Exp $
Author:
Sylvain Wallez
See Also:
Serialized Form

Inner Class Summary
static class BootstrapServlet.ConfigWrapper
          Implementation of ServletConfig passed to the actual servlet.
static class BootstrapServlet.ContextWrapper
          Wrapper for the ServletContext passed to the actual servlet.
 
Field Summary
protected  java.lang.ClassLoader classloader
           
protected  javax.servlet.ServletContext context
           
protected  javax.servlet.Servlet servlet
           
static java.lang.String SERVLET_CLASS
          The name of the actual servlet class.
 
Constructor Summary
BootstrapServlet()
           
 
Method Summary
 void destroy()
          Destroy the actual servlet
protected  java.lang.ClassLoader getClassLoader(java.lang.String contextDirParam)
          Get the classloader that will be used to create the actual servlet.
 void init(javax.servlet.ServletConfig config)
           
 void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)
          Service the request by delegating the call to the real servlet
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVLET_CLASS

public static final java.lang.String SERVLET_CLASS
The name of the actual servlet class.

servlet

protected javax.servlet.Servlet servlet

classloader

protected java.lang.ClassLoader classloader

context

protected javax.servlet.ServletContext context
Constructor Detail

BootstrapServlet

public BootstrapServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Overrides:
init in class javax.servlet.GenericServlet

getClassLoader

protected java.lang.ClassLoader getClassLoader(java.lang.String contextDirParam)
                                        throws javax.servlet.ServletException
Get the classloader that will be used to create the actual servlet.

service

public void service(javax.servlet.ServletRequest request,
                    javax.servlet.ServletResponse response)
             throws javax.servlet.ServletException,
                    java.io.IOException
Service the request by delegating the call to the real servlet
Overrides:
service in class javax.servlet.http.HttpServlet

destroy

public void destroy()
Destroy the actual servlet
Overrides:
destroy in class javax.servlet.GenericServlet


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.