@ManagedObject(value="Servlet Context Handler") public class ServletContextHandler extends ContextHandler
This extension 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);
This class should have been called ServletContext, but this would have
cause confusion with ServletContext.
| Modifier and Type | Class and Description |
|---|---|
class |
ServletContextHandler.Context |
static interface |
ServletContextHandler.Decorator
Deprecated.
use new
Decorator |
static class |
ServletContextHandler.JspConfig |
static class |
ServletContextHandler.JspPropertyGroup |
static interface |
ServletContextHandler.ServletContainerInitializerCaller |
static class |
ServletContextHandler.TagLib |
ContextHandler.AliasCheck, ContextHandler.ApproveAliases, ContextHandler.ApproveNonExistentDirectoryAliases, ContextHandler.Availability, ContextHandler.ContextScopeListener, ContextHandler.ContextStatus, ContextHandler.StaticContextAbstractHandler.ErrorDispatchHandlerAbstractLifeCycle.AbstractLifeCycleListenerGraceful.ShutdownLifeCycle.ListenerContainer.InheritedListener, Container.Listener| Modifier and Type | Field and Description |
|---|---|
static int |
GZIP |
static int |
NO_SECURITY |
static int |
NO_SESSIONS |
static int |
SECURITY |
static int |
SESSIONS |
DEFAULT_LISTENER_TYPE_INDEX, DEFAULT_MAX_FORM_CONTENT_SIZE, DEFAULT_MAX_FORM_KEYS, EXTENDED_LISTENER_TYPE_INDEX, MANAGED_ATTRIBUTES, MAX_FORM_CONTENT_SIZE_KEY, MAX_FORM_KEYS_KEY, SERVLET_LISTENER_TYPES, SERVLET_MAJOR_VERSION, SERVLET_MINOR_VERSION| Constructor and Description |
|---|
ServletContextHandler() |
ServletContextHandler(HandlerContainer parent,
SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler) |
ServletContextHandler(HandlerContainer parent,
String contextPath) |
ServletContextHandler(HandlerContainer parent,
String contextPath,
boolean sessions,
boolean security) |
ServletContextHandler(HandlerContainer parent,
String contextPath,
int options) |
ServletContextHandler(HandlerContainer parent,
String contextPath,
SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler) |
ServletContextHandler(HandlerContainer parent,
String contextPath,
SessionHandler sessionHandler,
SecurityHandler securityHandler,
ServletHandler servletHandler,
ErrorHandler errorHandler,
int options) |
ServletContextHandler(int options) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDecorator(ServletContextHandler.Decorator decorator)
Deprecated.
use the
DecoratedObjectFactory from getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") or getObjectFactory() instead |
void |
addEventListener(EventListener listener)
Add EventListener
Adds an EventListener to the list.
|
FilterHolder |
addFilter(Class<? extends Filter> filterClass,
String pathSpec,
EnumSet<DispatcherType> dispatches)
Convenience method to add a filter
|
void |
addFilter(FilterHolder holder,
String pathSpec,
EnumSet<DispatcherType> dispatches)
Convenience method to add a filter
|
FilterHolder |
addFilter(String filterClass,
String pathSpec,
EnumSet<DispatcherType> dispatches)
Convenience method to add a filter
|
ServletHolder |
addServlet(Class<? extends Servlet> servlet,
String pathSpec)
Convenience method to add a servlet.
|
void |
addServlet(ServletHolder servlet,
String pathSpec)
Convenience method to add a servlet.
|
ServletHolder |
addServlet(String className,
String pathSpec)
Convenience method to add a servlet.
|
void |
callContextDestroyed(ServletContextListener l,
ServletContextEvent e) |
void |
callContextInitialized(ServletContextListener l,
ServletContextEvent e) |
List<ServletContextHandler.Decorator> |
getDecorators()
Deprecated.
use the
DecoratedObjectFactory from getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") or getObjectFactory() instead |
Class<? extends SecurityHandler> |
getDefaultSecurityHandlerClass()
Get the defaultSecurityHandlerClass.
|
GzipHandler |
getGzipHandler() |
DecoratedObjectFactory |
getObjectFactory()
The DecoratedObjectFactory for use by IoC containers (weld / spring / etc)
|
SecurityHandler |
getSecurityHandler() |
static ServletContextHandler |
getServletContextHandler(ServletContext context) |
ServletHandler |
getServletHandler() |
SessionHandler |
getSessionHandler() |
void |
insertHandler(HandlerWrapper handler)
Insert a HandlerWrapper before the first Session,Security or ServletHandler
but after any other HandlerWrappers.
|
void |
setDecorators(List<ServletContextHandler.Decorator> decorators)
Deprecated.
use the
DecoratedObjectFactory from getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") or getObjectFactory() instead |
void |
setDefaultSecurityHandlerClass(Class<? extends SecurityHandler> defaultSecurityHandlerClass)
Set the defaultSecurityHandlerClass.
|
void |
setGzipHandler(GzipHandler gzipHandler) |
void |
setHandler(Handler handler) |
void |
setSecurityHandler(SecurityHandler securityHandler) |
void |
setServletHandler(ServletHandler servletHandler) |
Set<String> |
setServletSecurity(ServletRegistration.Dynamic registration,
ServletSecurityElement servletSecurityElement)
Delegate for ServletRegistration.Dynamic.setServletSecurity method
|
void |
setSessionHandler(SessionHandler sessionHandler) |
addAliasCheck, addLocaleEncoding, addVirtualHosts, checkAlias, checkContext, checkContextPath, checkVirtualHost, clearAliasChecks, clearAttributes, contextDestroyed, contextInitialized, doHandle, doScope, dump, getAliasChecks, getAllowNullPathInfo, getAttribute, getAttributeNames, getAttributes, getBaseResource, getClassLoader, getClassPath, getContextHandler, getContextPath, getContextPathEncoded, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getMimeTypes, getProtectedTargets, getResource, getResourceBase, getResourcePaths, getServerInfo, getServletContext, getVirtualHosts, getWelcomeFiles, handle, handle, isAvailable, isCompactPath, isDurableListener, isProgrammaticListener, isProtectedTarget, isShutdown, isUsingSecurityManager, loadClass, newResource, newResource, newResource, removeAttribute, removeEventListener, removeVirtualHosts, setAliasChecks, setAllowNullPathInfo, setAttribute, setAttributes, setAvailable, setBaseResource, setClassLoader, setCompactPath, setContextPath, setDisplayName, setErrorHandler, setEventListeners, setInitParameter, setLogger, setManagedAttribute, setMaxFormContentSize, setMaxFormKeys, setMimeTypes, setProtectedTargets, setResourceBase, setServer, setServerInfo, setUsingSecurityManager, setVirtualHosts, setWelcomeFiles, shutdown, toStringhandle, nextHandle, nextScopedestroy, getHandler, getHandlersfindContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassgetServeraddBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dumpObject, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, unmanage, updateBean, updateBean, updateBeansaddLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, start, stop, stopdumpContainer, dumpIterable, dumpMapEntries, dumpObjects, dumpSelf, namedpublic static final int SESSIONS
public static final int SECURITY
public static final int GZIP
public static final int NO_SESSIONS
public static final int NO_SECURITY
public ServletContextHandler()
public ServletContextHandler(int options)
public ServletContextHandler(HandlerContainer parent, String contextPath)
public ServletContextHandler(HandlerContainer parent, String contextPath, int options)
public ServletContextHandler(HandlerContainer parent, String contextPath, boolean sessions, boolean security)
public ServletContextHandler(HandlerContainer parent, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
public ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler)
public ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler, int options)
public void addEventListener(EventListener listener)
addEventListener in class ContextHandlerlistener - the listener to addServletContextListener,
ServletContextAttributeListener,
ServletRequestListener,
ServletRequestAttributeListenerpublic void setHandler(Handler handler)
setHandler in class HandlerWrapperhandler - Set the Handler which should be wrapped.public Class<? extends SecurityHandler> getDefaultSecurityHandlerClass()
public void setDefaultSecurityHandlerClass(Class<? extends SecurityHandler> defaultSecurityHandlerClass)
defaultSecurityHandlerClass - the defaultSecurityHandlerClass to set@ManagedAttribute(value="context security handler", readonly=true) public SecurityHandler getSecurityHandler()
@ManagedAttribute(value="context servlet handler", readonly=true) public ServletHandler getServletHandler()
@ManagedAttribute(value="context session handler", readonly=true) public SessionHandler getSessionHandler()
@ManagedAttribute(value="context gzip handler", readonly=true) public GzipHandler getGzipHandler()
public ServletHolder addServlet(String className, String pathSpec)
className - the servlet class namepathSpec - the path spec to map servlet topublic ServletHolder addServlet(Class<? extends Servlet> servlet, String pathSpec)
servlet - the servlet classpathSpec - the path spec to map servlet topublic void addServlet(ServletHolder servlet, String pathSpec)
servlet - the servlet holderpathSpec - the path specpublic void addFilter(FilterHolder holder, String pathSpec, EnumSet<DispatcherType> dispatches)
holder - the filter holderpathSpec - the path specdispatches - the dispatcher types for this filterpublic FilterHolder addFilter(Class<? extends Filter> filterClass, String pathSpec, EnumSet<DispatcherType> dispatches)
filterClass - the filter classpathSpec - the path specdispatches - the dispatcher types for this filterpublic FilterHolder addFilter(String filterClass, String pathSpec, EnumSet<DispatcherType> dispatches)
filterClass - the filter class namepathSpec - the path specdispatches - the dispatcher types for this filterpublic Set<String> setServletSecurity(ServletRegistration.Dynamic registration, ServletSecurityElement servletSecurityElement)
registration - ServletRegistration.Dynamic instance that setServletSecurity was called onservletSecurityElement - new security infopublic void callContextInitialized(ServletContextListener l, ServletContextEvent e)
public void callContextDestroyed(ServletContextListener l, ServletContextEvent e)
public void setSessionHandler(SessionHandler sessionHandler)
sessionHandler - The sessionHandler to set.public void setSecurityHandler(SecurityHandler securityHandler)
securityHandler - The SecurityHandler to set on this context.public void setGzipHandler(GzipHandler gzipHandler)
gzipHandler - The GzipHandler to set on this context.public void setServletHandler(ServletHandler servletHandler)
servletHandler - The servletHandler to set.public void insertHandler(HandlerWrapper handler)
insertHandler in class HandlerWrapperhandler - the wrapper to insertpublic DecoratedObjectFactory getObjectFactory()
@Deprecated public List<ServletContextHandler.Decorator> getDecorators()
DecoratedObjectFactory from getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") or getObjectFactory() instead@Deprecated public void setDecorators(List<ServletContextHandler.Decorator> decorators)
DecoratedObjectFactory from getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") or getObjectFactory() insteaddecorators - The list of ServletContextHandler.Decorators@Deprecated public void addDecorator(ServletContextHandler.Decorator decorator)
DecoratedObjectFactory from getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") or getObjectFactory() insteaddecorator - The decorator to addpublic static ServletContextHandler getServletContextHandler(ServletContext context)
Copyright © 2010 - 2020 Adobe. All Rights Reserved