- All Implemented Interfaces:
Supplier<org.eclipse.jetty.server.Handler>,Handler,HandlerContainer,org.eclipse.jetty.util.Attributes,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
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.ManagedAttributes is 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.maxFormKeys and
org.eclipse.jetty.server.Request.maxFormContentSize. These can also be configured with setMaxFormContentSize(int) and setMaxFormKeys(int)
The executor is made available via a context attributed org.eclipse.jetty.server.Executor.
By default, the context is created with the AllowedResourceAliasChecker which is configured to allow symlinks. If
this alias checker is not required, then clearAliasChecks() or setAliasChecks(List) should be called.
-
If this is added directly as a
Handleron theServerthis will supply theContextHandler.CoreContextHandlerassociated with thisContextHandler. This will wrap the request to aContextHandler.CoreContextRequestand fall through to theCoreToNestedHandlerwhich invokes theHttpChanneland this will eventually reachScopedHandler.handle(String, Request, HttpServletRequest, HttpServletResponse). -
If this is nested inside another
ContextHandlerand not added directly to the server then itsContextHandler.CoreContextHandlerwill never be added to the server. However it will still be created and itsContextHandler.ScopedContextwill be used to enter scope.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassContext.static interfaceListener for all threads entering context scope, including async IO callbacksstatic enumclassstatic classNested classes/interfaces inherited from class org.eclipse.jetty.ee9.nested.AbstractHandler
AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
org.eclipse.jetty.util.Attributes.Layer, org.eclipse.jetty.util.Attributes.Lazy, org.eclipse.jetty.util.Attributes.Mapped, org.eclipse.jetty.util.Attributes.Synthetic, org.eclipse.jetty.util.Attributes.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextHandler.APIContextprotected ContextHandler.ContextStatusstatic final intstatic final intstatic final intstatic final org.eclipse.jetty.util.component.Environmentstatic final intstatic final Stringstatic final Stringstatic final Class<?>[]static final intstatic final intFields inherited from class org.eclipse.jetty.ee9.nested.ScopedHandler
_nextScope, _outerScopeFields inherited from class org.eclipse.jetty.ee9.nested.HandlerWrapper
_handlerFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.Attributes
NULLFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionContextHandler(String contextPath) ContextHandler(String contextPath, Handler handler) protectedContextHandler(ContextHandler.APIContext context, org.eclipse.jetty.server.Handler.Container parent, String contextPath) ContextHandler(org.eclipse.jetty.server.Handler.Container parent) ContextHandler(org.eclipse.jetty.server.Handler.Container parent, String contextPath) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAliasCheck(org.eclipse.jetty.server.AliasCheck check) Add an AliasCheck instance to possibly permit aliased resourcesbooleanaddEventListener(EventListener listener) Add a context event listeners.voidaddLocaleEncoding(String locale, String encoding) protected voidaddProgrammaticListener(EventListener listener) Apply any necessary restrictions on a programmatic added listener.voidaddVirtualHosts(String[] virtualHosts) protected voidcallContextDestroyed(jakarta.servlet.ServletContextListener l, jakarta.servlet.ServletContextEvent e) protected voidcallContextInitialized(jakarta.servlet.ServletContextListener l, jakarta.servlet.ServletContextEvent e) booleancheckAlias(String path, org.eclipse.jetty.util.resource.Resource resource) voidclear the list of AliasChecksvoidvoidCall the ServletContextListeners with contextDestroyed.voidCall the ServletContextListeners contextInitialized methods.voiddoHandle(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Do the handler work within the scope.voiddoScope(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Scope the handlerprotected voiddoStart()protected voidprotected voiddoStop()protected voidvoiddump(Appendable out, String indent) protected voidenterScope(Request request, Object reason) protected voidorg.eclipse.jetty.server.Handlerget()List<org.eclipse.jetty.server.AliasCheck> booleangetAttribute(String name) org.eclipse.jetty.util.Attributesorg.eclipse.jetty.util.resource.ResourceMake best effort to extract a file classpath from the context classloaderstatic ContextHandlergetContextHandler(jakarta.servlet.ServletContext context) static ContextHandler.APIContextGet the current ServletContext implementation.static ContextHandlergetInitParameter(String name) getLocaleEncoding(String locale) getLocaleEncoding(Locale locale) Get the character encoding for a locale.Get all of the locale encodingsorg.slf4j.Loggerintintorg.eclipse.jetty.http.MimeTypes.Mutableorg.eclipse.jetty.util.resource.ResourceString[]Get the context path in a form suitable to be returned fromHttpServletRequest.getContextPath()orServletContext.getContextPath().org.eclipse.jetty.util.resource.ResourcegetResource(String pathInContext) Attempt to get a Resource from the Context.Deprecated.use #getBaseResource()getResourcePaths(String path) static jakarta.servlet.ServletContextgetServletContext(org.eclipse.jetty.server.Context context) String[]String[]voidvoidhandle(HttpChannel channel) voidHandle a runnable in the scope of this context and a particular requestvoidhandleAsync(HttpChannel channel) voidhandleCrossContextAsync(HttpChannel channel) A request has come in via an async dispatch from a different context.protected voidhandleOptions(Request request, Response response) voidinsertHandler(org.eclipse.jetty.server.Handler.Singleton coreHandler) Insert a handler between thegetCoreContextHandler()and this handler.booleanbooleanDeprecated, for removal: This API element is subject to removal in a future version.useCompactPathRulewithRewriteHandlerinstead.booleanCross context dispatch support.booleanisDurableListener(EventListener listener) booleanisProgrammaticListener(EventListener listener) booleanisProtectedTarget(String target) Check the target.booleanClass<?> org.eclipse.jetty.util.resource.ResourcenewResource(String uriOrPath) Convert a URL or path to a Resource.org.eclipse.jetty.util.resource.ResourcenewResource(URI uri) Convert URL to Resource wrapper forResourceFactory.newResource(URL)enables extensions to provide alternate resource implementations.org.eclipse.jetty.util.resource.ResourcenewResource(URL url) Convert URL to Resource wrapper forResourceFactory.newResource(URL)enables extensions to provide alternate resource implementations.removeAttribute(String name) booleanremoveEventListener(EventListener listener) voidremoveVirtualHosts(String[] virtualHosts) protected voidrequestDestroyed(Request baseRequest, jakarta.servlet.http.HttpServletRequest request) protected voidrequestInitialized(Request baseRequest, jakarta.servlet.http.HttpServletRequest request) voidsetAliasChecks(List<org.eclipse.jetty.server.AliasCheck> checks) Set list of AliasCheck instances.voidsetAllowNullPathInfo(boolean allowNullPathInfo) Set true if /context is not redirected to /context/.setAttribute(String name, Object value) voidsetAttributes(org.eclipse.jetty.util.Attributes attributes) voidsetAvailable(boolean available) Set Available status.voidsetBaseResource(org.eclipse.jetty.util.resource.Resource base) Set the base resource for this context.voidsetBaseResourceAsPath(Path base) Set the base resource for this context.voidSet the base resource for this context.voidsetClassLoader(ClassLoader classLoader) voidsetCompactPath(boolean compactPath) Deprecated, for removal: This API element is subject to removal in a future version.useCompactPathRulewithRewriteHandlerinstead.voidsetContextPath(String contextPath) voidsetCrossContextDispatchSupported(boolean supported) Cross context dispatch support.voidsetDefaultRequestCharacterEncoding(String encoding) voidsetDefaultResponseCharacterEncoding(String encoding) voidsetDisplayName(String displayName) voidsetErrorHandler(ErrorHandler errorHandler) setInitParameter(String name, String value) voidsetLogger(org.slf4j.Logger logger) voidsetMaxFormContentSize(int maxSize) Set the maximum size of a form post, to protect against DOS attacks from large forms.voidsetMaxFormKeys(int max) Set the maximum number of form Keys to protect against DOS attack from crafted hash keys.voidsetProtectedTargets(String[] targets) voidsetResourceBase(String resourceBase) Deprecated.use #setBaseResourcevoidsetServer(org.eclipse.jetty.server.Server server) voidsetUsingSecurityManager(boolean usingSecurityManager) voidsetVirtualHosts(String[] vhosts) voidsetWelcomeFiles(String[] files) protected voidExtensible startContext. this method is called fromdoStart()instead of a call to super.doStart().protected voidtoString()Methods inherited from class org.eclipse.jetty.ee9.nested.ScopedHandler
handle, nextHandle, nextScopeMethods inherited from class org.eclipse.jetty.ee9.nested.HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, getTail, insertHandler, setAsParent, setHandlerMethods inherited from class org.eclipse.jetty.ee9.nested.AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassMethods inherited from class org.eclipse.jetty.ee9.nested.AbstractHandler
doError, getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addManaged, contains, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Attributes
asAttributeMap, equals, hashCodeMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
-
Field Details
-
ENVIRONMENT
public static final org.eclipse.jetty.util.component.Environment ENVIRONMENT -
SERVLET_MAJOR_VERSION
public static final int SERVLET_MAJOR_VERSION- See Also:
-
SERVLET_MINOR_VERSION
public static final int SERVLET_MINOR_VERSION- See Also:
-
SERVLET_LISTENER_TYPES
-
DEFAULT_LISTENER_TYPE_INDEX
public static final int DEFAULT_LISTENER_TYPE_INDEX- See Also:
-
EXTENDED_LISTENER_TYPE_INDEX
public static final int EXTENDED_LISTENER_TYPE_INDEX- See Also:
-
MAX_FORM_KEYS_KEY
- See Also:
-
MAX_FORM_CONTENT_SIZE_KEY
- See Also:
-
DEFAULT_MAX_FORM_KEYS
public static final int DEFAULT_MAX_FORM_KEYS- See Also:
-
DEFAULT_MAX_FORM_CONTENT_SIZE
public static final int DEFAULT_MAX_FORM_CONTENT_SIZE- See Also:
-
_contextStatus
-
_apiContext
-
-
Constructor Details
-
ContextHandler
public ContextHandler() -
ContextHandler
-
ContextHandler
-
ContextHandler
public ContextHandler(org.eclipse.jetty.server.Handler.Container parent) -
ContextHandler
-
ContextHandler
protected ContextHandler(ContextHandler.APIContext context, org.eclipse.jetty.server.Handler.Container parent, String contextPath)
-
-
Method Details
-
getCurrentContext
Get the current ServletContext implementation.- Returns:
- ServletContext implementation
-
getCurrentContextHandler
-
getContextHandler
-
getServletContext
public static jakarta.servlet.ServletContext getServletContext(org.eclipse.jetty.server.Context context) -
get
-
getCoreContextHandler
-
insertHandler
public void insertHandler(org.eclipse.jetty.server.Handler.Singleton coreHandler) Insert a handler between thegetCoreContextHandler()and this handler.- Parameters:
coreHandler- A core handler to insert
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
IOException
-
getServletContext
-
getAllowNullPathInfo
@ManagedAttribute("Checks if the /context is not redirected to /context/") public boolean getAllowNullPathInfo()- Returns:
- the allowNullPathInfo true if /context is not redirected to /context/
-
setAllowNullPathInfo
public void setAllowNullPathInfo(boolean allowNullPathInfo) Set true if /context is not redirected to /context/.- Parameters:
allowNullPathInfo- true if /context is not redirected to /context/
-
setCrossContextDispatchSupported
public void setCrossContextDispatchSupported(boolean supported) Cross context dispatch support.- Parameters:
supported-Trueif cross context dispatch is supported- See Also:
-
isCrossContextDispatchSupported
public boolean isCrossContextDispatchSupported()Cross context dispatch support.- Returns:
Trueif cross context dispatch is supported- See Also:
-
setServer
public void setServer(org.eclipse.jetty.server.Server server) - Specified by:
setServerin interfaceHandler- Overrides:
setServerin classAbstractHandlerContainer
-
isUsingSecurityManager
public boolean isUsingSecurityManager() -
setUsingSecurityManager
public void setUsingSecurityManager(boolean usingSecurityManager) -
setVirtualHosts
-
addVirtualHosts
-
removeVirtualHosts
-
getVirtualHosts
@ManagedAttribute(value="Virtual hosts accepted by the context", readonly=true) public String[] getVirtualHosts() -
getAttribute
-
getAttributeNames
-
getAttributeNameSet
-
getAttributes
public org.eclipse.jetty.util.Attributes getAttributes()- Returns:
- Returns the attributes.
-
getClassLoader
- Returns:
- Returns the classLoader.
-
getClassPath
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 String getContextPath()- Returns:
- Returns the contextPath.
-
getContextPathEncoded
- Returns:
- Returns the encoded contextPath.
-
getRequestContextPath
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
-
setInitParameter
-
getInitParameterNames
-
getInitParams
-
getDisplayName
@ManagedAttribute(value="Display name of the Context", readonly=true) public String getDisplayName() -
addEventListener
Add a context event listeners.- Specified by:
addEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
addEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
addEventListenerin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Parameters:
listener- the event listener to add- Returns:
- true if the listener was added
- See Also:
-
removeEventListener
- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
removeEventListenerin classorg.eclipse.jetty.util.component.ContainerLifeCycle
-
addProgrammaticListener
Apply any necessary restrictions on a programmatic added listener.- Parameters:
listener- the programmatic listener to add
-
isProgrammaticListener
-
isDurableListener
-
isAvailable
public boolean isAvailable()- Returns:
- false if this context is unavailable (sends 503)
-
setAvailable
public void setAvailable(boolean available) Set Available status.- Parameters:
available- true to set as enabled
-
getLogger
public org.slf4j.Logger getLogger() -
setLogger
public void setLogger(org.slf4j.Logger logger) -
doStart
- Overrides:
doStartin classScopedHandler- Throws:
Exception
-
doStartInContext
-
doStop
- Overrides:
doStopin classAbstractHandler- Throws:
Exception
-
doStopInContext
-
startContext
Extensible startContext. this method is called fromdoStart()instead of a call to super.doStart(). This allows derived classes to insert additional handling (Eg configuration) before the call to super.doStart by this method will start contained handlers.- Throws:
Exception- if unable to start the context- See Also:
-
contextInitialized
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:
Exception
-
contextDestroyed
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:
Exception
-
stopContext
-
callContextInitialized
protected void callContextInitialized(jakarta.servlet.ServletContextListener l, jakarta.servlet.ServletContextEvent e) -
callContextDestroyed
protected void callContextDestroyed(jakarta.servlet.ServletContextListener l, jakarta.servlet.ServletContextEvent e) -
doScope
public void doScope(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException 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.response- The response as theResponseobject or a wrapper of that request.- Throws:
IOException- if unable to handle the request or response processingjakarta.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
-
requestInitialized
protected void requestInitialized(Request baseRequest, jakarta.servlet.http.HttpServletRequest request) -
requestDestroyed
protected void requestDestroyed(Request baseRequest, jakarta.servlet.http.HttpServletRequest request) -
doHandle
public void doHandle(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException 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.response- The response as theResponseobject or a wrapper of that request.- Throws:
IOException- if unable to handle the request or response processingjakarta.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
-
enterScope
-
exitScope
- Parameters:
request- A request that is applicable to the scope, or null
-
handle
-
handle
-
isProtectedTarget
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
- Parameters:
targets- Array of URL prefix. Each prefix is in the form /path and will match either /path exactly or /path/anything
-
getProtectedTargets
-
removeAttribute
-
setAttribute
-
setAttributes
public void setAttributes(org.eclipse.jetty.util.Attributes attributes) - Parameters:
attributes- The attributes to set.
-
clearAttributes
public void clearAttributes()- Specified by:
clearAttributesin interfaceorg.eclipse.jetty.util.Attributes
-
setClassLoader
- Parameters:
classLoader- The classLoader to set.
-
setDefaultRequestCharacterEncoding
-
getDefaultRequestCharacterEncoding
-
setDefaultResponseCharacterEncoding
-
getDefaultResponseCharacterEncoding
-
setContextPath
- Parameters:
contextPath- The _contextPath to set.
-
setDisplayName
- Parameters:
displayName- The servletContextName to set.
-
getBaseResource
@ManagedAttribute("document root for context") public org.eclipse.jetty.util.resource.Resource getBaseResource()- Returns:
- Returns the resourceBase.
-
getResourceBase
Deprecated.use #getBaseResource()- Returns:
- Returns the base resource as a string.
-
setBaseResource
public void setBaseResource(org.eclipse.jetty.util.resource.Resource base) Set the base resource for this context.- Parameters:
base- The resource used as the base for all static content of this context.
-
setBaseResourceAsPath
Set the base resource for this context.- Parameters:
base- The resource used as the base for all static content of this context.- See Also:
-
setBaseResourceAsString
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
Deprecated.use #setBaseResourceSet the base resource for this context.- Parameters:
resourceBase- A string representing the base resource for the context. Any string accepted byResourceFactory.newResource(String)may be passed and the call is equivalent tosetBaseResource(newResource(resourceBase));
-
getMimeTypes
public org.eclipse.jetty.http.MimeTypes.Mutable getMimeTypes()- Returns:
- Returns the mimeTypes.
-
setWelcomeFiles
-
getWelcomeFiles
@ManagedAttribute(value="Partial URIs of directory welcome files", readonly=true) public String[] getWelcomeFiles()- Returns:
- The names of the files which the server should consider to be welcome files in this context.
- See Also:
-
getErrorHandler
- Returns:
- Returns the errorHandler.
-
setErrorHandler
- Parameters:
errorHandler- The errorHandler to set.
-
getMaxFormContentSize
@ManagedAttribute("The maximum content size") public int getMaxFormContentSize() -
setMaxFormContentSize
public void setMaxFormContentSize(int maxSize) 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() -
setMaxFormKeys
public void setMaxFormKeys(int max) 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
Deprecated, for removal: This API element is subject to removal in a future version.useCompactPathRulewithRewriteHandlerinstead. Will be removed from ee10 onwards.Is a compacted path used for context-path and url-pattern matching?- Returns:
- True if URLs are compacted to replace multiple '/'s with a single '/'
- See Also:
-
setCompactPath
Deprecated, for removal: This API element is subject to removal in a future version.useCompactPathRulewithRewriteHandlerinstead. Will be removed from ee10 onwards.When performing context-path and url-pattern matching, do so with a compacted form of the request path.
Note: this compacted path is not exposed to the Servlet API, the original request path is used.
- Parameters:
compactPath- True if URLs are compacted to replace multiple '/'s with a single '/'- See Also:
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-
loadClass
- Throws:
ClassNotFoundException
-
addLocaleEncoding
-
getLocaleEncoding
-
getLocaleEncoding
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
-
getResource
public org.eclipse.jetty.util.resource.Resource getResource(String pathInContext) throws MalformedURLException Attempt to get a Resource from the Context.- Parameters:
pathInContext- the path within the base resource to attempt to get- Returns:
- the resource, or null if not available.
- Throws:
MalformedURLException- if unable to form a Resource from the provided path
-
checkAlias
- Parameters:
path- the path to check the alias forresource- the resource- Returns:
- True if the alias is OK
-
newResource
Convert URL to Resource wrapper forResourceFactory.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:
IOException- if unable to create a Resource from the URL
-
newResource
Convert URL to Resource wrapper forResourceFactory.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:
IOException- if unable to create a Resource from the URL
-
newResource
Convert a URL or path to a Resource. The default implementation is a wrapper forResourceFactory.newResource(String).- Parameters:
uriOrPath- The URL or path to convert- Returns:
- The Resource for the URL/path
- Throws:
IOException- The Resource could not be created.
-
getResourcePaths
-
addAliasCheck
public void addAliasCheck(org.eclipse.jetty.server.AliasCheck check) Add an AliasCheck instance to possibly permit aliased resources- Parameters:
check- The alias checker
-
getAliasChecks
- Returns:
- Immutable list of Alias checks
-
setAliasChecks
Set list of AliasCheck instances.- Parameters:
checks- list of AliasCheck instances
-
clearAliasChecks
public void clearAliasChecks()clear the list of AliasChecks -
handle
- Throws:
IOExceptionjakarta.servlet.ServletException
-
handleOptions
- Throws:
IOException
-
handleCrossContextAsync
public void handleCrossContextAsync(HttpChannel channel) throws IOException, jakarta.servlet.ServletException A request has come in via an async dispatch from a different context.- Parameters:
channel- the HttpChannel associated with the request- Throws:
IOExceptionjakarta.servlet.ServletException
-
handleAsync
- Throws:
IOExceptionjakarta.servlet.ServletException
-
getNestedResourceForTempDirName
public org.eclipse.jetty.util.resource.Resource getNestedResourceForTempDirName()
-