Class WebAppContext
- All Implemented Interfaces:
WebAppClassLoader.Context, org.eclipse.jetty.server.AliasCheck, org.eclipse.jetty.server.Deployable, org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.Handler.Container, org.eclipse.jetty.server.Handler.Singleton, org.eclipse.jetty.server.Request.Handler, org.eclipse.jetty.util.Attributes, org.eclipse.jetty.util.ClassVisibilityChecker, 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, org.eclipse.jetty.util.thread.Invocable
The WebAppContext handler is an extension of ContextHandler that
coordinates the construction and configuration of nested handlers:
ConstraintSecurityHandler, SessionHandler
and ServletHandler.
The handlers are configured by pluggable configuration classes, with
the default being WebXmlConfiguration and
JettyWebXmlConfiguration.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.ee10.servlet.ServletContextHandler
org.eclipse.jetty.ee10.servlet.ServletContextHandler.ContextStatus, org.eclipse.jetty.ee10.servlet.ServletContextHandler.JspConfig, org.eclipse.jetty.ee10.servlet.ServletContextHandler.JspPropertyGroup, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletContainerInitializerCaller, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletContainerInitializerStarter, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletContextApi, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletContextScopeListener, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletRequestInfo, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletResponseInfo, org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletScopedContext, org.eclipse.jetty.ee10.servlet.ServletContextHandler.TagLibNested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ContextHandler
org.eclipse.jetty.server.handler.ContextHandler.Availability, org.eclipse.jetty.server.handler.ContextHandler.ContextScopeListener, org.eclipse.jetty.server.handler.ContextHandler.ScopedContextNested classes/interfaces inherited from class org.eclipse.jetty.server.Handler.Abstract
org.eclipse.jetty.server.Handler.Abstract.NonBlockingNested 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.server.Handler
org.eclipse.jetty.server.Handler.Abstract, org.eclipse.jetty.server.Handler.AbstractContainer, org.eclipse.jetty.server.Handler.Collection, org.eclipse.jetty.server.Handler.Container, org.eclipse.jetty.server.Handler.Sequence, org.eclipse.jetty.server.Handler.Singleton, org.eclipse.jetty.server.Handler.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.server.Request.Handler
org.eclipse.jetty.server.Request.Handler.AbortException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClassMatcherDeprecated, for removal: This API element is subject to removal in a future version.static final ClassMatcherDeprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.DEFAULT_PROTECTED_CLASSESstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.HIDDEN_CLASSES_ATTRIBUTEinstead.static final StringDeprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.PROTECTED_CLASSES_ATTRIBUTEinstead.static final StringFields inherited from class org.eclipse.jetty.ee10.servlet.ServletContextHandler
__environment, _contextStatus, _jspConfig, _objFactory, _options, _securityHandler, _servletHandler, _sessionHandler, DEFAULT_LISTENER_TYPE_INDEX, DEFAULT_MAX_FORM_CONTENT_SIZE, DEFAULT_MAX_FORM_KEYS, ENVIRONMENT, EXTENDED_LISTENER_TYPE_INDEX, MAX_FORM_CONTENT_SIZE_KEY, MAX_FORM_KEYS_KEY, NO_SECURITY, NO_SESSIONS, SECURITY, SERVLET_LISTENER_TYPES, SESSIONSFields inherited from class org.eclipse.jetty.server.handler.ContextHandler
CROSS_CONTEXT_ATTRIBUTE, MANAGED_ATTRIBUTESFields 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.server.Deployable
ATTRIBUTE_PREFIX, CONFIGURATION_CLASSES, CONTAINER_SCAN_JARS, CONTEXT_HANDLER_CLASS, CONTEXT_PATH, DEFAULTS_DESCRIPTOR, EE_ENVIRONMENT_NAME_PATTERN, ENVIRONMENT, ENVIRONMENT_COMPARATOR, ENVIRONMENT_XML, EXTRACT_WARS, PARENT_LOADER_PRIORITY, SCI_EXCLUSION_PATTERN, SCI_ORDER, TEMP_DIR, WAR, WEBINF_SCAN_JARSFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP -
Constructor Summary
ConstructorsConstructorDescriptionWebAppContext(String webApp, String contextPath) WebAppContext(String contextPath, org.eclipse.jetty.ee10.servlet.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, org.eclipse.jetty.ee10.servlet.ServletHandler servletHandler, org.eclipse.jetty.ee10.servlet.ErrorHandler errorHandler, int options) WebAppContext(org.eclipse.jetty.ee10.servlet.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, org.eclipse.jetty.ee10.servlet.ServletHandler servletHandler, org.eclipse.jetty.ee10.servlet.ErrorHandler errorHandler) WebAppContext(org.eclipse.jetty.util.resource.Resource webApp, String contextPath) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguration(Configuration... configuration) voidaddHiddenClassMatcher(org.eclipse.jetty.util.ClassMatcher hiddenClasses) Add a ClassMatcher for hidden (server) classes by combining with any existing matcher.voidaddOverrideDescriptor(String overrideDescriptor) The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xmlvoidaddProtectedClassMatcher(org.eclipse.jetty.util.ClassMatcher protectedClasses) Add a ClassMatcher for protected (system) classes by combining with any existing matcher.static voidaddServerClasses(org.eclipse.jetty.server.Server server, String... patterns) Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.addProtectedClasses(Server, String...)voidaddServerClassMatcher(ClassMatcher serverClasses) Deprecated, for removal: This API element is subject to removal in a future version.static voidaddSystemClasses(org.eclipse.jetty.server.Server server, String... patterns) Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.addHiddenClasses(Server, String...)voidaddSystemClassMatcher(ClassMatcher systemClasses) Deprecated, for removal: This API element is subject to removal in a future version.protected voidPrevent the temp directory from being deleted during the normal stop sequence, and require thatContextHandler.cleanupAfterStop()is explicitly called after the webapp classloader is closedbooleanprotected ClassLoaderconfigureClassLoader(ClassLoader loader) Configure the contextClassLoader, potentially wrapping it.protected voidvoiddestroy()protected voiddoStart()voiddump(Appendable out, String indent) protected String<T> TgetConfiguration(Class<? extends T> configClass) String[]static WebAppContextThe default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xmlList<org.eclipse.jetty.util.resource.Resource> String[]org.eclipse.jetty.util.ClassMatcherThe override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xmlAn override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xmlString[]org.eclipse.jetty.util.ClassMatcherorg.eclipse.jetty.util.resource.ResourcegetResource(String pathInContext) getResourceAlias(String path) org.eclipse.jetty.util.resource.ResourceFactoryprotected org.eclipse.jetty.util.resource.ResourceIf the webapp has no baseresource yet, use the war to make the temp directory name.String[]Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.String[]Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Get an exception that caused the webapp to be unavailablegetWar()org.eclipse.jetty.util.resource.ResourcevoidinitializeDefaults(Map<String, String> properties) booleanbooleanIs the context Automatically configured.booleanbooleanbooleanbooleanbooleanbooleanisHiddenClass(Class<?> clazz) booleanisHiddenResource(String name, URL url) booleanbooleanbooleanisProtectedClass(Class<?> clazz) booleanisProtectedResource(String name, URL url) booleanisServerClass(Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.booleanisSystemClass(Class<?> clazz) Deprecated, for removal: This API element is subject to removal in a future version.booleanprotected voidprotected voidprotected Configurationsorg.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletContextApivoidvoidPre configure the web application.voidremoveConfiguration(Class<? extends Configuration>... configurations) voidremoveConfiguration(Configuration... configurations) booleanremoveEventListener(EventListener listener) removeResourceAlias(String alias) voidsetAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames) voidsetClassLoader(ClassLoader classLoader) voidsetConfigurationClasses(String[] configurations) voidsetConfigurationClasses(List<String> configurations) voidsetConfigurationDiscovered(boolean discovered) Set the configuration discovery mode.voidsetConfigurations(Configuration[] configurations) voidsetConfigurations(Configurations configurations) voidsetContextPath(String contextPath) voidsetContextWhiteList(String... contextWhiteList) Set the context white list In certain circumstances you want may want to deny access of one webapp from another when you may not fully trust the webapp.voidsetCopyWebDir(boolean copy) voidsetCopyWebInf(boolean copyWebInf) voidsetDefaultContextPath(String contextPath) voidsetDefaultsDescriptor(String defaultsDescriptor) The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xmlvoidsetDescriptor(String descriptor) Set the web.xml descriptor to use.voidsetDisplayName(String servletContextName) voidsetDistributable(boolean distributable) voidsetExtraClasspath(String extraClasspath) Set the Extra ClassPath via delimited String.voidsetExtraClasspath(List<org.eclipse.jetty.util.resource.Resource> extraClasspath) voidsetExtractWAR(boolean extractWAR) voidsetHiddenClassMatcher(org.eclipse.jetty.util.ClassMatcher hiddenClasses) Set the hidden (server) classes patterns.voidsetLogUrlOnStart(boolean logOnStart) Sets whether or not the web app name and URL is logged on startupvoidsetOverrideDescriptor(String overrideDescriptor) The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xmlvoidsetOverrideDescriptors(List<String> overrideDescriptors) The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xmlvoidsetParentLoaderPriority(boolean java2compliant) voidsetPermissions(PermissionCollection permissions) voidsetProtectedClassMatcher(org.eclipse.jetty.util.ClassMatcher protectedClasses) Set the protected (system) classes patterns.voidsetResourceAlias(String alias, String uri) Set Resource Alias.voidsetResourceAliases(Map<String, String> map) voidsetServer(org.eclipse.jetty.server.Server server) voidsetServerClassMatcher(ClassMatcher serverClasses) Deprecated, for removal: This API element is subject to removal in a future version.setServletSecurity(jakarta.servlet.ServletRegistration.Dynamic registration, jakarta.servlet.ServletSecurityElement servletSecurityElement) voidsetSystemClassMatcher(ClassMatcher systemClasses) Deprecated, for removal: This API element is subject to removal in a future version.voidsetThrowUnavailableOnStartupException(boolean throwIfStartupException) voidSet the war of the webapp.voidsetWarResource(org.eclipse.jetty.util.resource.Resource war) Set the war of the webapp as aResource.protected voidprotected voidContinue thestartContext()before callingsuper.startContext().protected voidprotected voidContinue thestopContext()before callingsuper.stopContext().toString()Methods inherited from class org.eclipse.jetty.ee10.servlet.ServletContextHandler
addEventListener, addFilter, addFilter, addFilter, addFilter, addLocaleEncoding, addProgrammaticListener, addRoles, addServlet, addServlet, addServlet, addServlet, addServletContainerInitializer, addServletContainerInitializer, addServletContainerInitializer, callContextDestroyed, callContextInitialized, contextDestroyed, contextInitialized, doStop, dynamicHolderAdded, getContext, getContextPathEncoded, getCurrentServletContext, getCurrentServletContextHandler, getDefaultRequestCharacterEncoding, getDefaultResponseCharacterEncoding, getDefaultSecurityHandlerClass, getInitParameter, getInitParameterNames, getInitParams, getInvocationType, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getObjectFactory, getRequestContextPath, getResourcePaths, getSecurityHandler, getServletContext, getServletContext, getServletContextHandler, getServletContextHandler, getServletHandler, getSessionHandler, getWelcomeFiles, handleByContextHandler, insertHandler, isDurableListener, isProgrammaticListener, isUsingSecurityManager, loadClass, newContext, newResource, newResource, newResource, newSecurityHandler, newServletContextRequest, newServletHandler, newSessionHandler, notifyEnterScope, notifyExitScope, requestDestroyed, requestInitialized, setDefaultRequestCharacterEncoding, setDefaultResponseCharacterEncoding, setDefaultSecurityHandlerClass, setHandler, setInitParameter, setLogger, setMaxFormContentSize, setMaxFormKeys, setSecurityHandler, setServletHandler, setSessionHandler, setTempDirectory, setUsingSecurityManager, setWelcomeFiles, wrapRequest, wrapResponseMethods inherited from class org.eclipse.jetty.server.handler.ContextHandler
addAliasCheck, addVirtualHosts, checkAlias, checkVirtualHost, clearAliasChecks, clearAttributes, enterScope, exitScope, getAliasChecks, getAllowNullPathInContext, getAttribute, getAttributeNameSet, getBaseName, getBaseResource, getClassLoader, getClassPath, getContextHandler, getContextPath, getCrossContextHandler, getCurrentContext, getCurrentContext, getCurrentContextHandler, getDisplayName, getErrorHandler, getMimeTypes, getProtectedTargets, getTempDirectory, getVirtualHosts, handle, handleMovedPermanently, handleUnavailable, isAvailable, isCrossContextDispatchSupported, isProtectedTarget, isTempDirectoryPersistent, removeAttribute, removeVirtualHosts, setAliasChecks, setAllowNullPathInContext, setAttribute, setAvailable, setBaseResource, setBaseResourceAsPath, setBaseResourceAsString, setCrossContextDispatchSupported, setErrorHandler, setProtectedTargets, setTempDirectoryPersistent, setVirtualHostsMethods inherited from class org.eclipse.jetty.server.Handler.Wrapper
getHandlerMethods inherited from class org.eclipse.jetty.server.Handler.AbstractContainer
findContainerOf, getDescendant, getDescendants, isDynamic, setDynamicMethods inherited from class org.eclipse.jetty.server.Handler.Abstract
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 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.server.Handler
getServerMethods inherited from interface org.eclipse.jetty.server.Handler.Container
getContainer, getDescendant, getDescendants, getDescendantsMethods inherited from interface org.eclipse.jetty.server.Handler.Singleton
getHandlers, getTail, setHandlerMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stopMethods inherited from interface WebAppClassLoader.Context
isServerResource, isSystemResource, newResource
-
Field Details
-
WEB_DEFAULTS_XML
- See Also:
-
SERVER_SYS_CLASSES
Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.PROTECTED_CLASSES_ATTRIBUTEinstead.- See Also:
-
SERVER_SRV_CLASSES
Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.HIDDEN_CLASSES_ATTRIBUTEinstead.- See Also:
-
__dftSystemClasses
Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.DEFAULT_PROTECTED_CLASSES -
__dftServerClasses
Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.DEFAULT_HIDDEN_CLASSES
-
-
Constructor Details
-
WebAppContext
public WebAppContext() -
WebAppContext
-
WebAppContext
- Parameters:
webApp- The URL or filename of the webapp directory or war file.contextPath- The context path
-
WebAppContext
public WebAppContext(org.eclipse.jetty.ee10.servlet.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, org.eclipse.jetty.ee10.servlet.ServletHandler servletHandler, org.eclipse.jetty.ee10.servlet.ErrorHandler errorHandler) - Parameters:
sessionHandler- SessionHandler for this web appsecurityHandler- SecurityHandler for this web appservletHandler- ServletHandler for this web apperrorHandler- ErrorHandler for this web app
-
WebAppContext
public WebAppContext(String contextPath, org.eclipse.jetty.ee10.servlet.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, org.eclipse.jetty.ee10.servlet.ServletHandler servletHandler, org.eclipse.jetty.ee10.servlet.ErrorHandler errorHandler, int options) - Parameters:
contextPath- the context pathsessionHandler- SessionHandler for this web appsecurityHandler- SecurityHandler for this web appservletHandler- ServletHandler for this web apperrorHandler- ErrorHandler for this web appoptions- the options (ServletContextHandler.SESSIONSand/orServletContextHandler.SECURITY)
-
-
Method Details
-
getCurrentWebAppContext
-
initializeDefaults
-
isContextPathDefault
public boolean isContextPathDefault() -
setContextPath
- Overrides:
setContextPathin classorg.eclipse.jetty.ee10.servlet.ServletContextHandler
-
setDefaultContextPath
-
setDisplayName
- Overrides:
setDisplayNamein classorg.eclipse.jetty.server.handler.ContextHandler- Parameters:
servletContextName- The servletContextName to set.
-
setResourceAlias
-
getResourceAliases
-
setResourceAliases
-
getResourceAlias
-
removeResourceAlias
-
setClassLoader
- Overrides:
setClassLoaderin classorg.eclipse.jetty.server.handler.ContextHandler
-
getResourceFactory
public org.eclipse.jetty.util.resource.ResourceFactory getResourceFactory() -
getResource
public org.eclipse.jetty.util.resource.Resource getResource(String pathInContext) throws MalformedURLException - Overrides:
getResourcein classorg.eclipse.jetty.ee10.servlet.ServletContextHandler- Throws:
MalformedURLException
-
isConfigurationDiscovered
public boolean isConfigurationDiscovered()Is the context Automatically configured.- Returns:
- true if configuration discovery.
-
setConfigurationDiscovered
public void setConfigurationDiscovered(boolean discovered) Set the configuration discovery mode. If configuration discovery is set to true, then the JSR315 servlet 3.0 discovered configuration features are enabled. These are:- Web Fragments
- META-INF/resource directories
- Parameters:
discovered- true if configuration discovery is enabled for automatic configuration from the context
-
preConfigure
Pre configure the web application.The method is normally called from
AbstractLifeCycle.start(). It performs the discovery of the configurations to be applied to this context, specifically:- Instantiate the
Configurationinstances with a call toloadConfigurations(). - Instantiates a classloader (if one is not already set)
- Calls the
Configuration.preConfigure(WebAppContext)method of all Configuration instances.
- Throws:
Exception- if unable to pre configure
- Instantiate the
-
configureClassLoader
Configure the contextClassLoader, potentially wrapping it.- Parameters:
loader- The loader initially set on this context bysetClassLoader(ClassLoader)- Returns:
- Either the configured loader, or a new
ClassLoaderthat uses the loader.
-
createTempDirectory
protected void createTempDirectory()- Overrides:
createTempDirectoryin classorg.eclipse.jetty.server.handler.ContextHandler
-
configure
-
postConfigure
-
doStart
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.eclipse.jetty.util.component.Destroyable- Overrides:
destroyin classorg.eclipse.jetty.server.handler.ContextHandler
-
getConfigurationClasses
@ManagedAttribute(value="configuration classes used to configure webapp", readonly=true) public String[] getConfigurationClasses()- Returns:
- Returns the configurations.
-
getConfigurations
- Returns:
- Returns the configurations.
-
getDefaultsDescriptor
@ManagedAttribute(value="default web.xml deascriptor applied before standard web.xml", readonly=true) public String getDefaultsDescriptor()The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml- Returns:
- Returns the defaultsDescriptor.
-
getOverrideDescriptor
The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml- Returns:
- Returns the Override Descriptor.
-
getOverrideDescriptors
-
getPermissions
- Specified by:
getPermissionsin interfaceWebAppClassLoader.Context- Returns:
- Returns the permissions.
-
setHiddenClassMatcher
public void setHiddenClassMatcher(org.eclipse.jetty.util.ClassMatcher hiddenClasses) Set the hidden (server) classes patterns.These classes/packages are used to implement the server and are hidden from the context. If the context needs to load these classes, it must have its own copy of them in WEB-INF/lib or WEB-INF/classes.
- Parameters:
hiddenClasses- the server classes pattern
-
setProtectedClassMatcher
public void setProtectedClassMatcher(org.eclipse.jetty.util.ClassMatcher protectedClasses) Set the protected (system) classes patterns.These classes/packages are provided by the JVM and cannot be replaced by classes of the same name from WEB-INF, regardless of the value of
setParentLoaderPriority(boolean).- Parameters:
protectedClasses- the system classes pattern
-
addHiddenClassMatcher
public void addHiddenClassMatcher(org.eclipse.jetty.util.ClassMatcher hiddenClasses) Add a ClassMatcher for hidden (server) classes by combining with any existing matcher.- Parameters:
hiddenClasses- The class matcher of patterns to add to the server ClassMatcher
-
addProtectedClassMatcher
public void addProtectedClassMatcher(org.eclipse.jetty.util.ClassMatcher protectedClasses) Add a ClassMatcher for protected (system) classes by combining with any existing matcher.- Parameters:
protectedClasses- The class matcher of patterns to add to the system ClassMatcher
-
getProtectedClassMatcher
public org.eclipse.jetty.util.ClassMatcher getProtectedClassMatcher()- Returns:
- The ClassMatcher used to match System (protected) classes
-
getHiddenClassMatcher
public org.eclipse.jetty.util.ClassMatcher getHiddenClassMatcher()- Returns:
- The ClassMatcher used to match Server (hidden) classes
-
getProtectedClasses
@ManagedAttribute(value="classes and packages protected by context classloader", readonly=true) public String[] getProtectedClasses() -
getHiddenClasses
@ManagedAttribute(value="classes and packages hidden by the context classloader", readonly=true) public String[] getHiddenClasses() -
isHiddenClass
- Specified by:
isHiddenClassin interfaceorg.eclipse.jetty.util.ClassVisibilityChecker
-
isProtectedClass
- Specified by:
isProtectedClassin interfaceorg.eclipse.jetty.util.ClassVisibilityChecker
-
isHiddenResource
- Specified by:
isHiddenResourcein interfaceWebAppClassLoader.Context
-
isProtectedResource
- Specified by:
isProtectedResourcein interfaceWebAppClassLoader.Context
-
setServerClassMatcher
@Deprecated(since="12.0.8", forRemoval=true) public void setServerClassMatcher(ClassMatcher serverClasses) Deprecated, for removal: This API element is subject to removal in a future version. -
setSystemClassMatcher
@Deprecated(since="12.0.8", forRemoval=true) public void setSystemClassMatcher(ClassMatcher systemClasses) Deprecated, for removal: This API element is subject to removal in a future version. -
addServerClassMatcher
@Deprecated(since="12.0.8", forRemoval=true) public void addServerClassMatcher(ClassMatcher serverClasses) Deprecated, for removal: This API element is subject to removal in a future version. -
addSystemClassMatcher
@Deprecated(since="12.0.8", forRemoval=true) public void addSystemClassMatcher(ClassMatcher systemClasses) Deprecated, for removal: This API element is subject to removal in a future version. -
getSystemClassMatcher
Deprecated, for removal: This API element is subject to removal in a future version. -
getServerClassMatcher
Deprecated, for removal: This API element is subject to removal in a future version. -
getSystemClasses
Deprecated, for removal: This API element is subject to removal in a future version. -
getServerClasses
Deprecated, for removal: This API element is subject to removal in a future version. -
isServerClass
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isServerClassin interfaceorg.eclipse.jetty.util.ClassVisibilityChecker
-
isSystemClass
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isSystemClassin interfaceorg.eclipse.jetty.util.ClassVisibilityChecker
-
setServer
public void setServer(org.eclipse.jetty.server.Server server) - Specified by:
setServerin interfaceorg.eclipse.jetty.server.Handler- Overrides:
setServerin classorg.eclipse.jetty.server.handler.ContextHandler
-
getWar
- Returns:
- Returns the war as a file or URL string (Resource).
The war may be different to the @link
ContextHandler.getBaseResource()if the war has been expanded and/or copied.
-
getWebInf
- Throws:
IOException
-
isDistributable
@ManagedAttribute("web application distributable") public boolean isDistributable()- Returns:
- Returns the distributable.
-
isExtractWAR
@ManagedAttribute(value="extract war", readonly=true) public boolean isExtractWAR()- Returns:
- Returns the extractWAR.
-
isCopyWebDir
@ManagedAttribute(value="webdir copied on deploy (allows hot replacement on windows)", readonly=true) public boolean isCopyWebDir()- Returns:
- True if the webdir is copied (to allow hot replacement of jars on windows)
-
isCopyWebInf
public boolean isCopyWebInf()- Returns:
- True if the web-inf lib and classes directories are copied (to allow hot replacement of jars on windows)
-
isParentLoaderPriority
@ManagedAttribute(value="parent classloader given priority", readonly=true) public boolean isParentLoaderPriority()- Specified by:
isParentLoaderPriorityin interfaceWebAppClassLoader.Context- Returns:
- True if the classloader should delegate first to the parent classloader (standard java behaviour) or false if the classloader should first try to load from WEB-INF/lib or WEB-INF/classes (servlet spec recommendation). Default is false or can be set by the system property org.eclipse.jetty.server.webapp.parentLoaderPriority
-
loadConfigurations
protected void loadConfigurations() -
newConfigurations
-
newServletContextApi
public org.eclipse.jetty.ee10.servlet.ServletContextHandler.ServletContextApi newServletContextApi()- Overrides:
newServletContextApiin classorg.eclipse.jetty.ee10.servlet.ServletContextHandler
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.server.handler.ContextHandler
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.ee10.servlet.ServletContextHandler- Throws:
IOException
-
setConfigurationClasses
- Parameters:
configurations- The configuration class names. If setConfigurations is not called these classes are used to create a configurations array.
-
setConfigurationClasses
-
setConfigurations
- Parameters:
configurations- The configurations to set.
-
setConfigurations
- Parameters:
configurations- The configurations to set.
-
addConfiguration
-
getConfiguration
-
removeConfiguration
-
removeConfiguration
-
setDefaultsDescriptor
The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml- Parameters:
defaultsDescriptor- The defaultsDescriptor to set.
-
setOverrideDescriptor
The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml- Parameters:
overrideDescriptor- The overrideDescritpor to set.
-
setOverrideDescriptors
-
addOverrideDescriptor
The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml- Parameters:
overrideDescriptor- The overrideDescriptor (file or URL) to add.
-
getDescriptor
- Returns:
- the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists.
-
setDescriptor
Set the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists..- Parameters:
descriptor- the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists.
-
setDistributable
public void setDistributable(boolean distributable) - Parameters:
distributable- The distributable to set.
-
removeEventListener
- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
removeEventListenerin classorg.eclipse.jetty.ee10.servlet.ServletContextHandler
-
setExtractWAR
public void setExtractWAR(boolean extractWAR) - Parameters:
extractWAR- True if war files are extracted
-
setCopyWebDir
public void setCopyWebDir(boolean copy) - Parameters:
copy- True if the webdir is copied (to allow hot replacement of jars)
-
setCopyWebInf
public void setCopyWebInf(boolean copyWebInf) - Parameters:
copyWebInf- True if the web-inf lib and classes directories are copied (to allow hot replacement of jars on windows)
-
setParentLoaderPriority
public void setParentLoaderPriority(boolean java2compliant) - Parameters:
java2compliant- True if the classloader should delegate first to the parent classloader (standard java behaviour) or false if the classloader should first try to load from WEB-INF/lib or WEB-INF/classes (servlet spec recommendation). Default is false or can be set by the system property org.eclipse.jetty.server.webapp.parentLoaderPriority
-
setPermissions
- Parameters:
permissions- The permissions to set.
-
setContextWhiteList
Set the context white list In certain circumstances you want may want to deny access of one webapp from another when you may not fully trust the webapp. Setting this white list will enable a check when a servlet calledServletContextHandler.Context#getContext(String), validating that the uriInPath for the given webapp has been declaratively allows access to the context.- Parameters:
contextWhiteList- the whitelist of contexts
-
setWar
Set the war of the webapp. From this value aContextHandler.setBaseResource(Resource)value is computed byWebInfConfiguration, which may be changed from the war URI by unpacking and/or copying.- Parameters:
war- The war to set as a file name or URL.
-
setWarResource
public void setWarResource(org.eclipse.jetty.util.resource.Resource war) Set the war of the webapp as aResource.- Parameters:
war- The war to set as a Resource.- See Also:
-
getExtraClasspath
@ManagedAttribute(value="extra classpath for context classloader", readonly=true) public List<org.eclipse.jetty.util.resource.Resource> getExtraClasspath()- Specified by:
getExtraClasspathin interfaceWebAppClassLoader.Context- Returns:
- Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.
-
setExtraClasspath
Set the Extra ClassPath via delimited String.This is a convenience method for
setExtraClasspath(List)- Parameters:
extraClasspath- Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.- See Also:
-
setExtraClasspath
-
isLogUrlOnStart
public boolean isLogUrlOnStart() -
setLogUrlOnStart
public void setLogUrlOnStart(boolean logOnStart) Sets whether or not the web app name and URL is logged on startup- Parameters:
logOnStart- whether or not the log message is created
-
isAllowDuplicateFragmentNames
public boolean isAllowDuplicateFragmentNames() -
setAllowDuplicateFragmentNames
public void setAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames) -
startContext
-
stopContext
-
startWebapp
Continue thestartContext()before callingsuper.startContext().- Throws:
Exception- If there was a problem starting
-
stopWebapp
Continue thestopContext()before callingsuper.stopContext().- Throws:
Exception- If there was a problem stopping
-
cleanupAfterStop
Prevent the temp directory from being deleted during the normal stop sequence, and require thatContextHandler.cleanupAfterStop()is explicitly called after the webapp classloader is closed- Overrides:
cleanupAfterStopin classorg.eclipse.jetty.server.handler.ContextHandler- Throws:
Exception
-
setServletSecurity
-
getMetaData
-
makeTempDirectory
-
getCanonicalNameForTmpDir
- Overrides:
getCanonicalNameForTmpDirin classorg.eclipse.jetty.server.handler.ContextHandler
-
getResourceForTempDirName
protected org.eclipse.jetty.util.resource.Resource getResourceForTempDirName()If the webapp has no baseresource yet, use the war to make the temp directory name.- Overrides:
getResourceForTempDirNamein classorg.eclipse.jetty.server.handler.ContextHandler- Returns:
- the baseresource if non null, or the war
-
addServerClasses
@Deprecated(since="12.0.8", forRemoval=true) public static void addServerClasses(org.eclipse.jetty.server.Server server, String... patterns) Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.addProtectedClasses(Server, String...)Add a Server Class pattern to use for all WebAppContexts.- Parameters:
server- TheServerinstance to add classes topatterns- the patterns to use- See Also:
-
addSystemClasses
@Deprecated(since="12.0.8", forRemoval=true) public static void addSystemClasses(org.eclipse.jetty.server.Server server, String... patterns) Deprecated, for removal: This API element is subject to removal in a future version.useWebAppClassLoading.addHiddenClasses(Server, String...)Add a System Class pattern to use for all WebAppContexts.- Parameters:
server- TheServerinstance to add classes topatterns- the patterns to use- See Also:
-
WebAppClassLoading.DEFAULT_HIDDEN_CLASSES