Package org.eclipse.jetty.servlet
Class ServletContextHandler
java.lang.Object
- All Implemented Interfaces:
Handler,HandlerContainer,Attributes,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,Graceful,LifeCycle
@ManagedObject("Servlet Context Handler")
@Deprecated(since="2021-05-27")
public class ServletContextHandler
extends ContextHandler
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
Servlet Context.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassDeprecated.static interfaceDeprecated.use newDecoratorstatic classDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static classDeprecated.static classDeprecated.static interfaceDeprecated.static classDeprecated.Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ContextHandler
ContextHandler.AliasCheck, ContextHandler.ApproveAliases, ContextHandler.ApproveNonExistentDirectoryAliases, ContextHandler.Availability, ContextHandler.ContextScopeListener, ContextHandler.ContextStatus, ContextHandler.StaticContextNested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.ShutdownNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler
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 Summary
ConstructorsConstructorDescriptionDeprecated.ServletContextHandler(int options) Deprecated.ServletContextHandler(HandlerContainer parent, String contextPath) Deprecated.ServletContextHandler(HandlerContainer parent, String contextPath, boolean sessions, boolean security) Deprecated.ServletContextHandler(HandlerContainer parent, String contextPath, int options) Deprecated.ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) Deprecated.ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler, int options) Deprecated.ServletContextHandler(HandlerContainer parent, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDecorator(ServletContextHandler.Decorator decorator) Deprecated.use theDecoratedObjectFactoryfrom getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") orgetObjectFactory()insteadvoidaddEventListener(EventListener listener) Deprecated.Add EventListener Adds an EventListener to the list.Deprecated.Convenience method to add a filteraddFilter(String filterClass, String pathSpec, EnumSet<DispatcherType> dispatches) Deprecated.Convenience method to add a filtervoidaddFilter(FilterHolder holder, String pathSpec, EnumSet<DispatcherType> dispatches) Deprecated.Convenience method to add a filteraddServlet(Class<? extends Servlet> servlet, String pathSpec) Deprecated.Convenience method to add a servlet.addServlet(String className, String pathSpec) Deprecated.Convenience method to add a servlet.voidaddServlet(ServletHolder servlet, String pathSpec) Deprecated.Convenience method to add a servlet.voidDeprecated.voidDeprecated.Deprecated.use theDecoratedObjectFactoryfrom getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") orgetObjectFactory()insteadClass<? extends SecurityHandler> Deprecated.Get the defaultSecurityHandlerClass.Deprecated.Deprecated.The DecoratedObjectFactory for use by IoC containers (weld / spring / etc)Deprecated.static ServletContextHandlergetServletContextHandler(ServletContext context) Deprecated.Deprecated.Deprecated.voidinsertHandler(HandlerWrapper handler) Deprecated.Insert a HandlerWrapper before the first Session,Security or ServletHandler but after any other HandlerWrappers.voidsetDecorators(List<ServletContextHandler.Decorator> decorators) Deprecated.use theDecoratedObjectFactoryfrom getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") orgetObjectFactory()insteadvoidsetDefaultSecurityHandlerClass(Class<? extends SecurityHandler> defaultSecurityHandlerClass) Deprecated.Set the defaultSecurityHandlerClass.voidsetGzipHandler(GzipHandler gzipHandler) Deprecated.voidsetHandler(Handler handler) Deprecated.voidsetSecurityHandler(SecurityHandler securityHandler) Deprecated.voidsetServletHandler(ServletHandler servletHandler) Deprecated.setServletSecurity(ServletRegistration.Dynamic registration, ServletSecurityElement servletSecurityElement) Deprecated.Delegate for ServletRegistration.Dynamic.setServletSecurity methodvoidsetSessionHandler(SessionHandler sessionHandler) Deprecated.Methods inherited from class org.eclipse.jetty.server.handler.ContextHandler
addAliasCheck, addLocaleEncoding, addVirtualHosts, checkAlias, checkContext, checkContextPath, checkVirtualHost, clearAliasChecks, clearAttributes, contextDestroyed, contextInitialized, doHandle, doScope, dump, getAliasChecks, getAllowNullPathInfo, getAttribute, getAttributeNames, getAttributeNameSet, getAttributes, getBaseResource, getClassLoader, getClassPath, getContextHandler, getContextPath, getContextPathEncoded, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getMimeTypes, getProtectedTargets, getRequestContextPath, 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, toStringMethods inherited from class org.eclipse.jetty.server.handler.ScopedHandler
handle, nextHandle, nextScopeMethods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, getHandler, getHandlersMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, 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, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Field Details
-
SESSIONS
public static final int SESSIONSDeprecated.- See Also:
-
SECURITY
public static final int SECURITYDeprecated.- See Also:
-
GZIP
public static final int GZIPDeprecated.- See Also:
-
NO_SESSIONS
public static final int NO_SESSIONSDeprecated.- See Also:
-
NO_SECURITY
public static final int NO_SECURITYDeprecated.- See Also:
-
-
Constructor Details
-
ServletContextHandler
public ServletContextHandler()Deprecated. -
ServletContextHandler
public ServletContextHandler(int options) Deprecated. -
ServletContextHandler
Deprecated. -
ServletContextHandler
Deprecated. -
ServletContextHandler
public ServletContextHandler(HandlerContainer parent, String contextPath, boolean sessions, boolean security) Deprecated. -
ServletContextHandler
public ServletContextHandler(HandlerContainer parent, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) Deprecated. -
ServletContextHandler
public ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler) Deprecated. -
ServletContextHandler
public ServletContextHandler(HandlerContainer parent, String contextPath, SessionHandler sessionHandler, SecurityHandler securityHandler, ServletHandler servletHandler, ErrorHandler errorHandler, int options) Deprecated.
-
-
Method Details
-
addEventListener
Deprecated.Add EventListener Adds an EventListener to the list. @see org.eclipse.jetty.server.handler.ContextHandler#addEventListener(). Also adds any listeners that are session related to the SessionHandler.- Overrides:
addEventListenerin classContextHandler- Parameters:
listener- the listener to add- See Also:
-
setHandler
Deprecated.- Overrides:
setHandlerin classHandlerWrapper- Parameters:
handler- Set theHandlerwhich should be wrapped.
-
getDefaultSecurityHandlerClass
Deprecated.Get the defaultSecurityHandlerClass.- Returns:
- the defaultSecurityHandlerClass
-
setDefaultSecurityHandlerClass
public void setDefaultSecurityHandlerClass(Class<? extends SecurityHandler> defaultSecurityHandlerClass) Deprecated.Set the defaultSecurityHandlerClass.- Parameters:
defaultSecurityHandlerClass- the defaultSecurityHandlerClass to set
-
getSecurityHandler
@ManagedAttribute(value="context security handler", readonly=true) public SecurityHandler getSecurityHandler()Deprecated.- Returns:
- Returns the securityHandler.
-
getServletHandler
@ManagedAttribute(value="context servlet handler", readonly=true) public ServletHandler getServletHandler()Deprecated.- Returns:
- Returns the servletHandler.
-
getSessionHandler
@ManagedAttribute(value="context session handler", readonly=true) public SessionHandler getSessionHandler()Deprecated.- Returns:
- Returns the sessionHandler.
-
getGzipHandler
Deprecated.- Returns:
- Returns the gzipHandler.
-
addServlet
Deprecated.Convenience method to add a servlet.- Parameters:
className- the servlet class namepathSpec- the path spec to map servlet to- Returns:
- the ServletHolder for the added servlet
-
addServlet
Deprecated.Convenience method to add a servlet.- Parameters:
servlet- the servlet classpathSpec- the path spec to map servlet to- Returns:
- the ServletHolder for the added servlet
-
addServlet
Deprecated.Convenience method to add a servlet.- Parameters:
servlet- the servlet holderpathSpec- the path spec
-
addFilter
Deprecated.Convenience method to add a filter- Parameters:
holder- the filter holderpathSpec- the path specdispatches- the dispatcher types for this filter
-
addFilter
public FilterHolder addFilter(Class<? extends Filter> filterClass, String pathSpec, EnumSet<DispatcherType> dispatches) Deprecated.Convenience method to add a filter- Parameters:
filterClass- the filter classpathSpec- the path specdispatches- the dispatcher types for this filter- Returns:
- the FilterHolder that was created
-
addFilter
public FilterHolder addFilter(String filterClass, String pathSpec, EnumSet<DispatcherType> dispatches) Deprecated.Convenience method to add a filter- Parameters:
filterClass- the filter class namepathSpec- the path specdispatches- the dispatcher types for this filter- Returns:
- the FilterHolder that was created
-
setServletSecurity
public Set<String> setServletSecurity(ServletRegistration.Dynamic registration, ServletSecurityElement servletSecurityElement) Deprecated.Delegate for ServletRegistration.Dynamic.setServletSecurity method- Parameters:
registration- ServletRegistration.Dynamic instance that setServletSecurity was called onservletSecurityElement- new security info- Returns:
- the set of exact URL mappings currently associated with the registration that are also present in the web.xml security constraints and thus will be unaffected by this call.
-
callContextInitialized
Deprecated. -
callContextDestroyed
Deprecated. -
setSessionHandler
Deprecated.- Parameters:
sessionHandler- The sessionHandler to set.
-
setSecurityHandler
Deprecated.- Parameters:
securityHandler- TheSecurityHandlerto set on this context.
-
setGzipHandler
Deprecated.- Parameters:
gzipHandler- TheGzipHandlerto set on this context.
-
setServletHandler
Deprecated.- Parameters:
servletHandler- The servletHandler to set.
-
insertHandler
Deprecated.Insert a HandlerWrapper before the first Session,Security or ServletHandler but after any other HandlerWrappers.- Overrides:
insertHandlerin classHandlerWrapper- Parameters:
handler- the wrapper to insert
-
getObjectFactory
Deprecated.The DecoratedObjectFactory for use by IoC containers (weld / spring / etc)- Returns:
- The DecoratedObjectFactory
-
getDecorators
Deprecated.use theDecoratedObjectFactoryfrom getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") orgetObjectFactory()instead- Returns:
- The decorator list used to resource inject new Filters, Servlets and EventListeners
-
setDecorators
Deprecated.use theDecoratedObjectFactoryfrom getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") orgetObjectFactory()instead- Parameters:
decorators- The list ofServletContextHandler.Decorators
-
addDecorator
Deprecated.use theDecoratedObjectFactoryfrom getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") orgetObjectFactory()instead- Parameters:
decorator- The decorator to add
-
getServletContextHandler
Deprecated.
-