|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mortbay.component.AbstractLifeCycle org.mortbay.jetty.handler.AbstractHandler org.mortbay.jetty.servlet.ServletHandler
public class ServletHandler
Servlet HttpHandler. This handler maps requests to servlets that implement the javax.servlet.http.HttpServlet API.
This handler does not implement the full J2EE features and is intended to be used when a full web application is not required. Specifically filters and request wrapping are not supported.
org.mortbay.jetty.servlet.WebAppContext
Nested Class Summary | |
---|---|
private class |
ServletHandler.CachedChain
|
private class |
ServletHandler.Chain
|
Field Summary | |
---|---|
private static String |
__AllowString
|
static String |
__DEFAULT_SERVLET
|
static String |
__J_S_CONTEXT_TEMPDIR
|
static String |
__J_S_ERROR_EXCEPTION
|
static String |
__J_S_ERROR_EXCEPTION_TYPE
|
static String |
__J_S_ERROR_MESSAGE
|
static String |
__J_S_ERROR_REQUEST_URI
|
static String |
__J_S_ERROR_SERVLET_NAME
|
static String |
__J_S_ERROR_STATUS_CODE
|
protected HashMap[] |
_chainCache
|
private ContextHandler |
_contextHandler
|
private boolean |
_filterChainsCached
|
private FilterMapping[] |
_filterMappings
|
private Map |
_filterNameMap
|
private MultiMap |
_filterNameMappings
|
private List |
_filterPathMappings
|
private FilterHolder[] |
_filters
|
private boolean |
_initializeAtStart
|
protected HashMap[] |
_namedChainCache
|
private ContextHandler.Context |
_servletContext
|
private ServletMapping[] |
_servletMappings
|
private Map |
_servletNameMap
|
private PathMap |
_servletPathMap
|
private ServletHolder[] |
_servlets
|
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 | |
---|---|
ServletHandler()
Constructor. |
Method Summary | |
---|---|
protected void |
doStart()
|
protected void |
doStop()
|
Object |
getContextLog()
|
private FilterChain |
getFilterChain(int requestType,
String pathInContext,
ServletHolder servletHolder)
|
FilterMapping[] |
getFilterMappings()
|
FilterHolder[] |
getFilters()
Get Filters. |
private PathMap.Entry |
getHolderEntry(String pathInContext)
ServletHolder matching path. |
RequestDispatcher |
getRequestDispatcher(String uriInContext)
|
ServletContext |
getServletContext()
|
ServletMapping[] |
getServletMappings()
|
ServletHolder[] |
getServlets()
Get Servlets. |
boolean |
handle(String target,
HttpServletRequest request,
HttpServletResponse response,
int type)
Generic Jetty request handler. |
void |
initialize()
Initialize filters and load-on-startup servlets. |
boolean |
isFilterChainsCached()
|
boolean |
isInitializeAtStart()
|
protected void |
notFound(HttpServletRequest request,
HttpServletResponse response)
|
void |
setContextLog(Object contextLog)
|
void |
setFilterChainsCached(boolean filterChainsCached)
|
void |
setFilterMappings(FilterMapping[] filterMappings)
|
void |
setFilters(FilterHolder[] holders)
Get Filters. |
void |
setInitializeAtStart(boolean initializeAtStart)
|
void |
setServer(Server server)
|
void |
setServletMappings(ServletMapping[] servletMappings)
|
void |
setServlets(ServletHolder[] holders)
Get Servlets. |
protected void |
updateMappings()
|
Methods inherited from class org.mortbay.jetty.handler.AbstractHandler |
---|
getServer, toString |
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 |
---|
private static String __AllowString
public static final String __DEFAULT_SERVLET
public static final String __J_S_CONTEXT_TEMPDIR
public static final String __J_S_ERROR_EXCEPTION
public static final String __J_S_ERROR_EXCEPTION_TYPE
public static final String __J_S_ERROR_MESSAGE
public static final String __J_S_ERROR_REQUEST_URI
public static final String __J_S_ERROR_SERVLET_NAME
public static final String __J_S_ERROR_STATUS_CODE
private ContextHandler _contextHandler
private ContextHandler.Context _servletContext
private FilterHolder[] _filters
private FilterMapping[] _filterMappings
private boolean _filterChainsCached
private ServletHolder[] _servlets
private ServletMapping[] _servletMappings
private boolean _initializeAtStart
private transient Map _filterNameMap
private transient List _filterPathMappings
private transient MultiMap _filterNameMappings
private transient Map _servletNameMap
private transient PathMap _servletPathMap
protected transient HashMap[] _chainCache
protected transient HashMap[] _namedChainCache
Constructor Detail |
---|
public ServletHandler()
Method Detail |
---|
public void setServer(Server server)
setServer
in interface Handler
setServer
in class AbstractHandler
protected void doStart() throws Exception
doStart
in class AbstractHandler
Exception
protected void doStop() throws Exception
doStop
in class AbstractHandler
Exception
public Object getContextLog()
public FilterMapping[] getFilterMappings()
public FilterHolder[] getFilters()
private PathMap.Entry getHolderEntry(String pathInContext)
pathInContext
- Path within _context.
public RequestDispatcher getRequestDispatcher(String uriInContext)
ipath
-
public ServletContext getServletContext()
public ServletMapping[] getServletMappings()
public ServletHolder[] getServlets()
public boolean handle(String target, HttpServletRequest request, HttpServletResponse response, int type) throws IOException
Handler
target
- The target of the request - either a URI or a name.request
- The request either as the Request
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Request object if required.response
- The response as the Response
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Response object if required.type
- The dispatch mode: Handler.REQUEST
, Handler.FORWARD
, Handler.INCLUDE
, Handler.ERROR
IOException
private FilterChain getFilterChain(int requestType, String pathInContext, ServletHolder servletHolder)
public boolean isInitializeAtStart()
public void setInitializeAtStart(boolean initializeAtStart)
initializeAtStart
- The initializeAtStart to set.public void initialize() throws Exception
Exception
public boolean isFilterChainsCached()
protected void updateMappings()
protected void notFound(HttpServletRequest request, HttpServletResponse response) throws IOException
IOException
public void setContextLog(Object contextLog)
contextLog
- The contextLog to set.public void setFilterChainsCached(boolean filterChainsCached)
filterChainsCached
- The filterChainsCached to set.public void setFilterMappings(FilterMapping[] filterMappings)
filterMappings
- The filterMappings to set.public void setFilters(FilterHolder[] holders)
public void setServletMappings(ServletMapping[] servletMappings)
servletMappings
- The servletMappings to set.public void setServlets(ServletHolder[] holders)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |