Class ContextHandler
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.handler.AbstractHandler
-
- org.eclipse.jetty.server.handler.AbstractHandlerContainer
-
- org.eclipse.jetty.server.handler.HandlerWrapper
-
- org.eclipse.jetty.server.handler.ScopedHandler
-
- org.eclipse.jetty.server.handler.ContextHandler
-
- All Implemented Interfaces:
Handler,HandlerContainer,Attributes,Container,Destroyable,Dumpable,Dumpable.DumpableContainer,Graceful,LifeCycle
- Direct Known Subclasses:
MovedContextHandler,ServletContextHandler
@ManagedObject("URI Context") @Deprecated(since="2021-05-27") public class ContextHandler extends ScopedHandler implements Attributes, Graceful
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.ContextHandler.This handler wraps a call to handle by setting the context and servlet path, plus setting the context classloader.
If the context init parameter
org.eclipse.jetty.server.context.ManagedAttributesis set to a comma separated list of names, then they are treated as context attribute names, which if set as attributes are passed to the servers Container so that they may be managed with JMX.The maximum size of a form that can be processed by this context is controlled by the system properties
org.eclipse.jetty.server.Request.maxFormKeysandorg.eclipse.jetty.server.Request.maxFormContentSize. These can also be configured withsetMaxFormContentSize(int)andsetMaxFormKeys(int)The executor is made available via a context attributed
org.eclipse.jetty.server.Executor.By default, the context is created with the
AllowedResourceAliasCheckerwhich is configured to allow symlinks. If this alias checker is not required, thenclearAliasChecks()orsetAliasChecks(List)should be called.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceContextHandler.AliasCheckDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static classContextHandler.ApproveAliasesDeprecated.static classContextHandler.ApproveNonExistentDirectoryAliasesDeprecated.static classContextHandler.AvailabilityDeprecated.classContextHandler.ContextDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static interfaceContextHandler.ContextScopeListenerDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.static classContextHandler.ContextStatusDeprecated.static classContextHandler.StaticContextDeprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.-
Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
AbstractHandler.ErrorDispatchHandler
-
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Wrapper
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful
Graceful.Shutdown
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_LISTENER_TYPE_INDEXDeprecated.static intDEFAULT_MAX_FORM_CONTENT_SIZEDeprecated.static intDEFAULT_MAX_FORM_KEYSDeprecated.static intEXTENDED_LISTENER_TYPE_INDEXDeprecated.static java.lang.StringMANAGED_ATTRIBUTESDeprecated.If a context attribute with this name is set, it is interpreted as a comma separated list of attribute name.static java.lang.StringMAX_FORM_CONTENT_SIZE_KEYDeprecated.static java.lang.StringMAX_FORM_KEYS_KEYDeprecated.static java.lang.Class<?>[]SERVLET_LISTENER_TYPESDeprecated.static intSERVLET_MAJOR_VERSIONDeprecated.static intSERVLET_MINOR_VERSIONDeprecated.
-
Constructor Summary
Constructors Constructor Description ContextHandler()Deprecated.ContextHandler(java.lang.String contextPath)Deprecated.ContextHandler(HandlerContainer parent, java.lang.String contextPath)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAliasCheck(ContextHandler.AliasCheck check)Deprecated.Add an AliasCheck instance to possibly permit aliased resourcesvoidaddEventListener(java.util.EventListener listener)Deprecated.Add a context event listeners.voidaddLocaleEncoding(java.lang.String locale, java.lang.String encoding)Deprecated.voidaddVirtualHosts(java.lang.String[] virtualHosts)Deprecated.Either set virtual hosts or add to an existing set of virtual hosts.booleancheckAlias(java.lang.String path, Resource resource)Deprecated.booleancheckContext(java.lang.String target, Request baseRequest, HttpServletResponse response)Deprecated.booleancheckContextPath(java.lang.String uri)Deprecated.booleancheckVirtualHost(Request baseRequest)Deprecated.voidclearAliasChecks()Deprecated.clear the list of AliasChecksvoidclearAttributes()Deprecated.voidcontextDestroyed()Deprecated.Call the ServletContextListeners with contextDestroyed.voidcontextInitialized()Deprecated.Call the ServletContextListeners contextInitialized methods.voiddoHandle(java.lang.String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)Deprecated.Do the handler work within the scope.voiddoScope(java.lang.String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)Deprecated.Scope the handlervoiddump(java.lang.Appendable out, java.lang.String indent)Deprecated.Dump this object (and children) into an Appendable using the provided indent after any new lines.java.util.List<ContextHandler.AliasCheck>getAliasChecks()Deprecated.booleangetAllowNullPathInfo()Deprecated.java.lang.ObjectgetAttribute(java.lang.String name)Deprecated.java.util.Enumeration<java.lang.String>getAttributeNames()Deprecated.java.util.Set<java.lang.String>getAttributeNameSet()Deprecated.AttributesgetAttributes()Deprecated.ResourcegetBaseResource()Deprecated.java.lang.ClassLoadergetClassLoader()Deprecated.java.lang.StringgetClassPath()Deprecated.Make best effort to extract a file classpath from the context classloaderstatic ContextHandlergetContextHandler(ServletContext context)Deprecated.java.lang.StringgetContextPath()Deprecated.java.lang.StringgetContextPathEncoded()Deprecated.static ContextHandler.ContextgetCurrentContext()Deprecated.Get the current ServletContext implementation.java.lang.StringgetDisplayName()Deprecated.ErrorHandlergetErrorHandler()Deprecated.java.util.EventListener[]getEventListeners()Deprecated.java.lang.StringgetInitParameter(java.lang.String name)Deprecated.java.util.Enumeration<java.lang.String>getInitParameterNames()Deprecated.java.util.Map<java.lang.String,java.lang.String>getInitParams()Deprecated.java.lang.StringgetLocaleEncoding(java.lang.String locale)Deprecated.java.lang.StringgetLocaleEncoding(java.util.Locale locale)Deprecated.Get the character encoding for a locale.java.util.Map<java.lang.String,java.lang.String>getLocaleEncodings()Deprecated.Get all of the locale encodingsLoggergetLogger()Deprecated.intgetMaxFormContentSize()Deprecated.intgetMaxFormKeys()Deprecated.MimeTypesgetMimeTypes()Deprecated.java.lang.String[]getProtectedTargets()Deprecated.java.lang.StringgetRequestContextPath()Deprecated.Get the context path in a form suitable to be returned fromHttpServletRequest.getContextPath()orServletContext.getContextPath().ResourcegetResource(java.lang.String path)Deprecated.java.lang.StringgetResourceBase()Deprecated.java.util.Set<java.lang.String>getResourcePaths(java.lang.String path)Deprecated.static java.lang.StringgetServerInfo()Deprecated.ContextHandler.ContextgetServletContext()Deprecated.java.lang.String[]getVirtualHosts()Deprecated.Get the virtual hosts for the context.java.lang.String[]getWelcomeFiles()Deprecated.voidhandle(java.lang.Runnable runnable)Deprecated.voidhandle(Request request, java.lang.Runnable runnable)Deprecated.Handle a runnable in the scope of this context and a particular requestbooleanisAvailable()Deprecated.booleanisCompactPath()Deprecated.booleanisDurableListener(java.util.EventListener listener)Deprecated.booleanisProgrammaticListener(java.util.EventListener listener)Deprecated.booleanisProtectedTarget(java.lang.String target)Deprecated.Check the target.booleanisShutdown()Deprecated.booleanisUsingSecurityManager()Deprecated.java.lang.Class<?>loadClass(java.lang.String className)Deprecated.ResourcenewResource(java.lang.String urlOrPath)Deprecated.Convert a URL or path to a Resource.ResourcenewResource(java.net.URI uri)Deprecated.Convert URL to Resource wrapper forResource.newResource(URL)enables extensions to provide alternate resource implementations.ResourcenewResource(java.net.URL url)Deprecated.Convert URL to Resource wrapper forResource.newResource(URL)enables extensions to provide alternate resource implementations.voidremoveAttribute(java.lang.String name)Deprecated.voidremoveEventListener(java.util.EventListener listener)Deprecated.Remove a context event listeners.voidremoveVirtualHosts(java.lang.String[] virtualHosts)Deprecated.Removes an array of virtual host entries, if this removes all entries the _vhosts will be set to nullvoidsetAliasChecks(java.util.List<ContextHandler.AliasCheck> checks)Deprecated.voidsetAllowNullPathInfo(boolean allowNullPathInfo)Deprecated.voidsetAttribute(java.lang.String name, java.lang.Object value)Deprecated.voidsetAttributes(Attributes attributes)Deprecated.voidsetAvailable(boolean available)Deprecated.Set Available status.voidsetBaseResource(Resource base)Deprecated.Set the base resource for this context.voidsetClassLoader(java.lang.ClassLoader classLoader)Deprecated.voidsetCompactPath(boolean compactPath)Deprecated.voidsetContextPath(java.lang.String contextPath)Deprecated.voidsetDisplayName(java.lang.String servletContextName)Deprecated.voidsetErrorHandler(ErrorHandler errorHandler)Deprecated.voidsetEventListeners(java.util.EventListener[] eventListeners)Deprecated.Set the context event listeners.java.lang.StringsetInitParameter(java.lang.String name, java.lang.String value)Deprecated.voidsetLogger(Logger logger)Deprecated.voidsetManagedAttribute(java.lang.String name, java.lang.Object value)Deprecated.voidsetMaxFormContentSize(int maxSize)Deprecated.Set the maximum size of a form post, to protect against DOS attacks from large forms.voidsetMaxFormKeys(int max)Deprecated.Set the maximum number of form Keys to protect against DOS attack from crafted hash keys.voidsetMimeTypes(MimeTypes mimeTypes)Deprecated.voidsetProtectedTargets(java.lang.String[] targets)Deprecated.voidsetResourceBase(java.lang.String resourceBase)Deprecated.Set the base resource for this context.voidsetServer(Server server)Deprecated.static voidsetServerInfo(java.lang.String serverInfo)Deprecated.voidsetUsingSecurityManager(boolean usingSecurityManager)Deprecated.voidsetVirtualHosts(java.lang.String[] vhosts)Deprecated.Set the virtual hosts for the context.voidsetWelcomeFiles(java.lang.String[] files)Deprecated.java.util.concurrent.Future<java.lang.Void>shutdown()Deprecated.Set shutdown status.java.lang.StringtoString()Deprecated.-
Methods inherited from class org.eclipse.jetty.server.handler.ScopedHandler
handle, nextHandle, nextScope
-
Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
destroy, getHandler, getHandlers, insertHandler, setHandler
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
-
Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
getServer
-
Methods 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, updateBeans
-
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
-
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
-
-
-
Field Detail
-
SERVLET_MAJOR_VERSION
public static final int SERVLET_MAJOR_VERSION
Deprecated.- See Also:
- Constant Field Values
-
SERVLET_MINOR_VERSION
public static final int SERVLET_MINOR_VERSION
Deprecated.- See Also:
- Constant Field Values
-
SERVLET_LISTENER_TYPES
public static final java.lang.Class<?>[] SERVLET_LISTENER_TYPES
Deprecated.
-
DEFAULT_LISTENER_TYPE_INDEX
public static final int DEFAULT_LISTENER_TYPE_INDEX
Deprecated.- See Also:
- Constant Field Values
-
EXTENDED_LISTENER_TYPE_INDEX
public static final int EXTENDED_LISTENER_TYPE_INDEX
Deprecated.- See Also:
- Constant Field Values
-
MANAGED_ATTRIBUTES
public static final java.lang.String MANAGED_ATTRIBUTES
Deprecated.If a context attribute with this name is set, it is interpreted as a comma separated list of attribute name. Any other context attributes that are set with a name from this list will result in a call tosetManagedAttribute(String, Object), which typically initiates the creation of a JMX MBean for the attribute value.- See Also:
- Constant Field Values
-
MAX_FORM_KEYS_KEY
public static final java.lang.String MAX_FORM_KEYS_KEY
Deprecated.- See Also:
- Constant Field Values
-
MAX_FORM_CONTENT_SIZE_KEY
public static final java.lang.String MAX_FORM_CONTENT_SIZE_KEY
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_MAX_FORM_KEYS
public static final int DEFAULT_MAX_FORM_KEYS
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_MAX_FORM_CONTENT_SIZE
public static final int DEFAULT_MAX_FORM_CONTENT_SIZE
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ContextHandler
public ContextHandler()
Deprecated.
-
ContextHandler
public ContextHandler(java.lang.String contextPath)
Deprecated.
-
ContextHandler
public ContextHandler(HandlerContainer parent, java.lang.String contextPath)
Deprecated.
-
-
Method Detail
-
getCurrentContext
public static ContextHandler.Context getCurrentContext()
Deprecated.Get the current ServletContext implementation.- Returns:
- ServletContext implementation
-
getContextHandler
public static ContextHandler getContextHandler(ServletContext context)
Deprecated.
-
getServerInfo
public static java.lang.String getServerInfo()
Deprecated.
-
setServerInfo
public static void setServerInfo(java.lang.String serverInfo)
Deprecated.
-
dump
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOExceptionDeprecated.Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Overrides:
dumpin classContainerLifeCycle- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
java.io.IOException- if unable to write to Appendable
-
getServletContext
public ContextHandler.Context getServletContext()
Deprecated.
-
getAllowNullPathInfo
@ManagedAttribute("Checks if the /context is not redirected to /context/") public boolean getAllowNullPathInfo()
Deprecated.- Returns:
- the allowNullPathInfo true if /context is not redirected to /context/
-
setAllowNullPathInfo
public void setAllowNullPathInfo(boolean allowNullPathInfo)
Deprecated.- Parameters:
allowNullPathInfo- true if /context is not redirected to /context/
-
setServer
public void setServer(Server server)
Deprecated.- Specified by:
setServerin interfaceHandler- Overrides:
setServerin classAbstractHandlerContainer
-
isUsingSecurityManager
public boolean isUsingSecurityManager()
Deprecated.
-
setUsingSecurityManager
public void setUsingSecurityManager(boolean usingSecurityManager)
Deprecated.
-
setVirtualHosts
public void setVirtualHosts(java.lang.String[] vhosts)
Deprecated.Set the virtual hosts for the context. Only requests that have a matching host header or fully qualified URL will be passed to that context with a virtual host name. A context with no virtual host names or a null virtual host name is available to all requests that are not served by a context with a matching virtual host name.- Parameters:
vhosts- Array of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with '@connectorname', in which case they will match only if the theConnector.getName()for the request also matches. If an entry is just '@connectorname' it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed and non of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.
-
addVirtualHosts
public void addVirtualHosts(java.lang.String[] virtualHosts)
Deprecated.Either set virtual hosts or add to an existing set of virtual hosts.- Parameters:
virtualHosts- Array of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with '@connectorname', in which case they will match only if the theConnector.getName()for the request also matches. If an entry is just '@connectorname' it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed and non of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.
-
removeVirtualHosts
public void removeVirtualHosts(java.lang.String[] virtualHosts)
Deprecated.Removes an array of virtual host entries, if this removes all entries the _vhosts will be set to null- Parameters:
virtualHosts- Array of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with '@connectorname', in which case they will match only if the theConnector.getName()for the request also matches. If an entry is just '@connectorname' it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed and non of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.
-
getVirtualHosts
@ManagedAttribute(value="Virtual hosts accepted by the context", readonly=true) public java.lang.String[] getVirtualHosts()
Deprecated.Get the virtual hosts for the context. Only requests that have a matching host header or fully qualified URL will be passed to that context with a virtual host name. A context with no virtual host names or a null virtual host name is available to all requests that are not served by a context with a matching virtual host name.- Returns:
- Array of virtual hosts that this context responds to. A null/empty array means any hostname is acceptable. Host names may be String
representation of IP addresses. Host names may start with '*.' to wildcard one level of names. Hosts and wildcard hosts may be followed with
'@connectorname', in which case they will match only if the the
Connector.getName()for the request also matches. If an entry is just '@connectorname' it will match any host if that connector was used. Note - In previous versions if one or more connectorname only entries existed and non of the connectors matched the handler would not match regardless of any hostname entries. If there is one or more connectorname only entries and one or more host only entries but no hostname and connector entries we assume the old behavior and will log a warning. The warning can be removed by removing the host entries that were previously being ignored, or modifying to include a hostname and connectorname entry.
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Deprecated.- Specified by:
getAttributein interfaceAttributes
-
getAttributeNames
public java.util.Enumeration<java.lang.String> getAttributeNames()
Deprecated.- Specified by:
getAttributeNamesin interfaceAttributes
-
getAttributeNameSet
public java.util.Set<java.lang.String> getAttributeNameSet()
Deprecated.- Specified by:
getAttributeNameSetin interfaceAttributes
-
getAttributes
public Attributes getAttributes()
Deprecated.- Returns:
- Returns the attributes.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Deprecated.- Returns:
- Returns the classLoader.
-
getClassPath
@ManagedAttribute("The file classpath") public java.lang.String getClassPath()
Deprecated.Make best effort to extract a file classpath from the context classloader- Returns:
- Returns the classLoader.
-
getContextPath
@ManagedAttribute("True if URLs are compacted to replace the multiple \'/\'s with a single \'/\'") public java.lang.String getContextPath()
Deprecated.- Returns:
- Returns the contextPath.
-
getContextPathEncoded
public java.lang.String getContextPathEncoded()
Deprecated.- Returns:
- Returns the encoded contextPath.
-
getRequestContextPath
public java.lang.String getRequestContextPath()
Deprecated.Get the context path in a form suitable to be returned fromHttpServletRequest.getContextPath()orServletContext.getContextPath().- Returns:
- Returns the encoded contextPath, or empty string for root context
-
getInitParameter
public java.lang.String getInitParameter(java.lang.String name)
Deprecated.
-
setInitParameter
public java.lang.String setInitParameter(java.lang.String name, java.lang.String value)Deprecated.
-
getInitParameterNames
public java.util.Enumeration<java.lang.String> getInitParameterNames()
Deprecated.
-
getInitParams
@ManagedAttribute("Initial Parameter map for the context") public java.util.Map<java.lang.String,java.lang.String> getInitParams()
Deprecated.- Returns:
- Returns the initParams.
-
getDisplayName
@ManagedAttribute(value="Display name of the Context", readonly=true) public java.lang.String getDisplayName()
Deprecated.
-
getEventListeners
public java.util.EventListener[] getEventListeners()
Deprecated.
-
setEventListeners
public void setEventListeners(java.util.EventListener[] eventListeners)
Deprecated.Set the context event listeners.- Parameters:
eventListeners- the event listeners- See Also:
ServletContextListener,ServletContextAttributeListener,ServletRequestListener,ServletRequestAttributeListener
-
addEventListener
public void addEventListener(java.util.EventListener listener)
Deprecated.Add a context event listeners.- Parameters:
listener- the event listener to add- See Also:
ServletContextListener,ServletContextAttributeListener,ServletRequestListener,ServletRequestAttributeListener
-
removeEventListener
public void removeEventListener(java.util.EventListener listener)
Deprecated.Remove a context event listeners.- Parameters:
listener- the event listener to remove- See Also:
ServletContextListener,ServletContextAttributeListener,ServletRequestListener,ServletRequestAttributeListener
-
isProgrammaticListener
public boolean isProgrammaticListener(java.util.EventListener listener)
Deprecated.
-
isDurableListener
public boolean isDurableListener(java.util.EventListener listener)
Deprecated.
-
isShutdown
@ManagedAttribute("true for graceful shutdown, which allows existing requests to complete") public boolean isShutdown()
Deprecated.- Specified by:
isShutdownin interfaceGraceful- Returns:
- true if this context is shutting down
-
shutdown
public java.util.concurrent.Future<java.lang.Void> shutdown()
Deprecated.Set shutdown status. This field allows for graceful shutdown of a context. A started context may be put into non accepting state so that existing requests can complete, but no new requests are accepted.
-
isAvailable
public boolean isAvailable()
Deprecated.- Returns:
- false if this context is unavailable (sends 503)
-
setAvailable
public void setAvailable(boolean available)
Deprecated.Set Available status.- Parameters:
available- true to set as enabled
-
getLogger
public Logger getLogger()
Deprecated.
-
setLogger
public void setLogger(Logger logger)
Deprecated.
-
contextInitialized
public void contextInitialized() throws java.lang.ExceptionDeprecated.Call the ServletContextListeners contextInitialized methods. This can be called from a ServletHandler during the proper sequence of initializing filters, servlets and listeners. However, if there is no ServletHandler, the ContextHandler will call this method during doStart().- Throws:
java.lang.Exception
-
contextDestroyed
public void contextDestroyed() throws java.lang.ExceptionDeprecated.Call the ServletContextListeners with contextDestroyed. This method can be called from a ServletHandler in the proper sequence of destroying filters, servlets and listeners. If there is no ServletHandler, the ContextHandler must ensure these listeners are called instead.- Throws:
java.lang.Exception
-
checkVirtualHost
public boolean checkVirtualHost(Request baseRequest)
Deprecated.
-
checkContextPath
public boolean checkContextPath(java.lang.String uri)
Deprecated.
-
checkContext
public boolean checkContext(java.lang.String target, Request baseRequest, HttpServletResponse response) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
doScope
public void doScope(java.lang.String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletExceptionDeprecated.Description copied from class:ScopedHandlerScope the handlerDerived implementations should call
ScopedHandler.nextScope(String, Request, HttpServletRequest, HttpServletResponse)- Overrides:
doScopein classScopedHandler- Parameters:
target- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request. Themethod can be used access the Request object if required.HttpConnection.getCurrentConnection().getHttpChannel().getRequest()response- The response as theResponseobject or a wrapper of that request. Themethod can be used access the Response object if required.HttpConnection.getCurrentConnection().getHttpChannel().getResponse()- Throws:
java.io.IOException- if unable to handle the request or response processingServletException- if unable to handle the request or response due to underlying servlet issue- See Also:
ScopedHandler.doScope(java.lang.String, org.eclipse.jetty.server.Request, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-
doHandle
public void doHandle(java.lang.String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletExceptionDeprecated.Description copied from class:ScopedHandlerDo the handler work within the scope.Derived implementations should call
ScopedHandler.nextHandle(String, Request, HttpServletRequest, HttpServletResponse)- Specified by:
doHandlein classScopedHandler- Parameters:
target- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request. Themethod can be used access the Request object if required.HttpConnection.getCurrentConnection().getHttpChannel().getRequest()response- The response as theResponseobject or a wrapper of that request. Themethod can be used access the Response object if required.HttpConnection.getCurrentConnection().getHttpChannel().getResponse()- Throws:
java.io.IOException- if unable to handle the request or response processingServletException- if unable to handle the request or response due to underlying servlet issue- See Also:
ScopedHandler.doHandle(java.lang.String, org.eclipse.jetty.server.Request, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
-
handle
public void handle(Request request, java.lang.Runnable runnable)
Deprecated.Handle a runnable in the scope of this context and a particular request- Parameters:
request- The request to scope the thread to (may be null if no particular request is in scope)runnable- The runnable to run.
-
handle
public void handle(java.lang.Runnable runnable)
Deprecated.
-
isProtectedTarget
public boolean isProtectedTarget(java.lang.String target)
Deprecated.Check the target. Called byScopedHandler.handle(String, Request, HttpServletRequest, HttpServletResponse)when a target within a context is determined. If the target is protected, 404 is returned.- Parameters:
target- the target to test- Returns:
- true if target is a protected target
-
setProtectedTargets
public void setProtectedTargets(java.lang.String[] targets)
Deprecated.- Parameters:
targets- Array of URL prefix. Each prefix is in the form /path and will match either /path exactly or /path/anything
-
getProtectedTargets
public java.lang.String[] getProtectedTargets()
Deprecated.
-
removeAttribute
public void removeAttribute(java.lang.String name)
Deprecated.- Specified by:
removeAttributein interfaceAttributes
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Deprecated.- Specified by:
setAttributein interfaceAttributes
-
setAttributes
public void setAttributes(Attributes attributes)
Deprecated.- Parameters:
attributes- The attributes to set.
-
clearAttributes
public void clearAttributes()
Deprecated.- Specified by:
clearAttributesin interfaceAttributes
-
setManagedAttribute
@Deprecated public void setManagedAttribute(java.lang.String name, java.lang.Object value)Deprecated.
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
Deprecated.- Parameters:
classLoader- The classLoader to set.
-
setContextPath
public void setContextPath(java.lang.String contextPath)
Deprecated.- Parameters:
contextPath- The _contextPath to set.
-
setDisplayName
public void setDisplayName(java.lang.String servletContextName)
Deprecated.- Parameters:
servletContextName- The servletContextName to set.
-
getBaseResource
public Resource getBaseResource()
Deprecated.- Returns:
- Returns the resourceBase.
-
getResourceBase
@ManagedAttribute("document root for context") public java.lang.String getResourceBase()
Deprecated.- Returns:
- Returns the base resource as a string.
-
setBaseResource
public void setBaseResource(Resource base)
Deprecated.Set the base resource for this context.- Parameters:
base- The resource used as the base for all static content of this context.- See Also:
setResourceBase(String)
-
setResourceBase
public void setResourceBase(java.lang.String resourceBase)
Deprecated.Set the base resource for this context.- Parameters:
resourceBase- A string representing the base resource for the context. Any string accepted byResource.newResource(String)may be passed and the call is equivalent tosetBaseResource(newResource(resourceBase));
-
getMimeTypes
public MimeTypes getMimeTypes()
Deprecated.- Returns:
- Returns the mimeTypes.
-
setMimeTypes
public void setMimeTypes(MimeTypes mimeTypes)
Deprecated.- Parameters:
mimeTypes- The mimeTypes to set.
-
setWelcomeFiles
public void setWelcomeFiles(java.lang.String[] files)
Deprecated.
-
getWelcomeFiles
@ManagedAttribute(value="Partial URIs of directory welcome files", readonly=true) public java.lang.String[] getWelcomeFiles()
Deprecated.- Returns:
- The names of the files which the server should consider to be welcome files in this context.
- See Also:
- The Servlet Specification,
setWelcomeFiles(java.lang.String[])
-
getErrorHandler
@ManagedAttribute("The error handler to use for the context") public ErrorHandler getErrorHandler()
Deprecated.- Returns:
- Returns the errorHandler.
-
setErrorHandler
public void setErrorHandler(ErrorHandler errorHandler)
Deprecated.- Parameters:
errorHandler- The errorHandler to set.
-
getMaxFormContentSize
@ManagedAttribute("The maximum content size") public int getMaxFormContentSize()
Deprecated.
-
setMaxFormContentSize
public void setMaxFormContentSize(int maxSize)
Deprecated.Set the maximum size of a form post, to protect against DOS attacks from large forms.- Parameters:
maxSize- the maximum size of the form content (in bytes)
-
getMaxFormKeys
public int getMaxFormKeys()
Deprecated.
-
setMaxFormKeys
public void setMaxFormKeys(int max)
Deprecated.Set the maximum number of form Keys to protect against DOS attack from crafted hash keys.- Parameters:
max- the maximum number of form keys
-
isCompactPath
public boolean isCompactPath()
Deprecated.- Returns:
- True if URLs are compacted to replace multiple '/'s with a single '/'
-
setCompactPath
public void setCompactPath(boolean compactPath)
Deprecated.- Parameters:
compactPath- True if URLs are compacted to replace multiple '/'s with a single '/'
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classAbstractLifeCycle
-
loadClass
public java.lang.Class<?> loadClass(java.lang.String className) throws java.lang.ClassNotFoundExceptionDeprecated.- Throws:
java.lang.ClassNotFoundException
-
addLocaleEncoding
public void addLocaleEncoding(java.lang.String locale, java.lang.String encoding)Deprecated.
-
getLocaleEncoding
public java.lang.String getLocaleEncoding(java.lang.String locale)
Deprecated.
-
getLocaleEncoding
public java.lang.String getLocaleEncoding(java.util.Locale locale)
Deprecated.Get the character encoding for a locale. The full locale name is first looked up in the map of encodings. If no encoding is found, then the locale language is looked up.- Parameters:
locale- aLocalevalue- Returns:
- a
Stringrepresenting the character encoding for the locale or null if none found.
-
getLocaleEncodings
public java.util.Map<java.lang.String,java.lang.String> getLocaleEncodings()
Deprecated.Get all of the locale encodings- Returns:
- a map of all the locale encodings: key is name of the locale and value is the char encoding
-
getResource
public Resource getResource(java.lang.String path) throws java.net.MalformedURLException
Deprecated.- Throws:
java.net.MalformedURLException
-
checkAlias
public boolean checkAlias(java.lang.String path, Resource resource)Deprecated.- Parameters:
path- the path to check the alias forresource- the resource- Returns:
- True if the alias is OK
-
newResource
public Resource newResource(java.net.URL url) throws java.io.IOException
Deprecated.Convert URL to Resource wrapper forResource.newResource(URL)enables extensions to provide alternate resource implementations.- Parameters:
url- the url to convert to a Resource- Returns:
- the Resource for that url
- Throws:
java.io.IOException- if unable to create a Resource from the URL
-
newResource
public Resource newResource(java.net.URI uri) throws java.io.IOException
Deprecated.Convert URL to Resource wrapper forResource.newResource(URL)enables extensions to provide alternate resource implementations.- Parameters:
uri- the URI to convert to a Resource- Returns:
- the Resource for that URI
- Throws:
java.io.IOException- if unable to create a Resource from the URL
-
newResource
public Resource newResource(java.lang.String urlOrPath) throws java.io.IOException
Deprecated.Convert a URL or path to a Resource. The default implementation is a wrapper forResource.newResource(String).- Parameters:
urlOrPath- The URL or path to convert- Returns:
- The Resource for the URL/path
- Throws:
java.io.IOException- The Resource could not be created.
-
getResourcePaths
public java.util.Set<java.lang.String> getResourcePaths(java.lang.String path)
Deprecated.
-
addAliasCheck
public void addAliasCheck(ContextHandler.AliasCheck check)
Deprecated.Add an AliasCheck instance to possibly permit aliased resources- Parameters:
check- The alias checker
-
getAliasChecks
public java.util.List<ContextHandler.AliasCheck> getAliasChecks()
Deprecated.- Returns:
- Immutable list of Alias checks
-
setAliasChecks
public void setAliasChecks(java.util.List<ContextHandler.AliasCheck> checks)
Deprecated.- Parameters:
checks- list of AliasCheck instances
-
clearAliasChecks
public void clearAliasChecks()
Deprecated.clear the list of AliasChecks
-
-