org.mortbay.jetty.servlet
Class Context

java.lang.Object
  extended byorg.mortbay.component.AbstractLifeCycle
      extended byorg.mortbay.jetty.handler.AbstractHandler
          extended byorg.mortbay.jetty.handler.AbstractHandlerContainer
              extended byorg.mortbay.jetty.handler.HandlerWrapper
                  extended byorg.mortbay.jetty.handler.ContextHandler
                      extended byorg.mortbay.jetty.servlet.Context
All Implemented Interfaces:
Attributes, Handler, HandlerContainer, LifeCycle
Direct Known Subclasses:
WebAppContext

public class Context
extends ContextHandler

Servlet Context. This conveniance extention to the ContextHandler allows for simple construction of a context with ServletHandler and optionally session and security handlers, et.

   new ServletContext("/context",Context.SESSIONS|Context.NO_SECURITY);
 


Nested Class Summary
 
Nested classes inherited from class org.mortbay.jetty.handler.ContextHandler
ContextHandler.Context
 
Field Summary
protected  SecurityHandler _securityHandler
           
protected  ServletHandler _servletHandler
           
protected  SessionHandler _sessionHandler
           
static int NO_SECURITY
           
static int NO_SESSIONS
           
static int SECURITY
           
static int SESSIONS
           
 
Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
_string
 
Fields inherited from interface org.mortbay.jetty.Handler
ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST
 
Constructor Summary
Context()
           
Context(HandlerContainer parent, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
           
Context(HandlerContainer parent, String contextPath)
           
Context(HandlerContainer parent, String contextPath, boolean sessions, boolean security)
           
Context(HandlerContainer parent, String contextPath, int options)
           
 
Method Summary
 ServletHolder addServlet(Class servlet, String pathSpec)
          conveniance method to add a servlet.
 void addServlet(ServletHolder servlet, String pathSpec)
          conveniance method to add a servlet.
 ServletHolder addServlet(String className, String pathSpec)
          conveniance method to add a servlet.
 SecurityHandler getSecurityHandler()
           
 ServletHandler getServletHandler()
           
 SessionHandler getSessionHandler()
           
 
Methods inherited from class org.mortbay.jetty.handler.ContextHandler
addLocaleEncoding, clearAttributes, doStart, doStop, getAttribute, getAttributeNames, getAttributes, getBaseResource, getClassLoader, getConnectorNames, getContextPath, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getHosts, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getMimeTypes, getResource, getResourceBase, getResourcePaths, getVirtualHosts, getWelcomeFiles, handle, isProtectedTarget, isShutdown, loadClass, removeAttribute, setAttribute, setAttributes, setBaseResource, setClassLoader, setConnectorNames, setContextPath, setDisplayName, setErrorHandler, setEventListeners, setHosts, setInitParams, setMimeTypes, setResourceBase, setServer, setShutdown, setVirtualHosts, setWelcomeFiles, startContext, toString
 
Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper
addHandler, expandChildren, getHandler, setHandler
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer
expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
 
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
getServer
 
Methods inherited from class org.mortbay.component.AbstractLifeCycle
isFailed, isRunning, isStarted, isStarting, isStopping, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mortbay.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopping, start, stop
 

Field Detail

SESSIONS

public static final int SESSIONS
See Also:
Constant Field Values

SECURITY

public static final int SECURITY
See Also:
Constant Field Values

NO_SESSIONS

public static final int NO_SESSIONS
See Also:
Constant Field Values

NO_SECURITY

public static final int NO_SECURITY
See Also:
Constant Field Values

_securityHandler

protected SecurityHandler _securityHandler

_servletHandler

protected ServletHandler _servletHandler

_sessionHandler

protected SessionHandler _sessionHandler
Constructor Detail

Context

public Context()

Context

public Context(HandlerContainer parent,
               String contextPath)

Context

public Context(HandlerContainer parent,
               String contextPath,
               int options)

Context

public Context(HandlerContainer parent,
               String contextPath,
               boolean sessions,
               boolean security)

Context

public Context(HandlerContainer parent,
               SessionHandler sessionHandler,
               SecurityHandler securityHandler,
               ServletHandler servletHandler,
               ErrorHandler errorHandler)
Method Detail

getSecurityHandler

public SecurityHandler getSecurityHandler()
Returns:
Returns the securityHandler.

getServletHandler

public ServletHandler getServletHandler()
Returns:
Returns the servletHandler.

getSessionHandler

public SessionHandler getSessionHandler()
Returns:
Returns the sessionHandler.

addServlet

public ServletHolder addServlet(String className,
                                String pathSpec)
conveniance method to add a servlet.


addServlet

public ServletHolder addServlet(Class servlet,
                                String pathSpec)
conveniance method to add a servlet.


addServlet

public void addServlet(ServletHolder servlet,
                       String pathSpec)
conveniance method to add a servlet.