Class WebAppContext
- All Implemented Interfaces:
org.eclipse.jetty.server.Handler,org.eclipse.jetty.server.HandlerContainer,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.Graceful,org.eclipse.jetty.util.component.LifeCycle,WebAppClassLoader.Context
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.servlet.ServletContextHandler
ServletContextHandler.Decorator, ServletContextHandler.Initializer, ServletContextHandler.JspConfig, ServletContextHandler.JspPropertyGroup, ServletContextHandler.ServletContainerInitializerCaller, ServletContextHandler.TagLibNested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ContextHandler
org.eclipse.jetty.server.handler.ContextHandler.AliasCheck, org.eclipse.jetty.server.handler.ContextHandler.ApproveAliases, org.eclipse.jetty.server.handler.ContextHandler.ApproveNonExistentDirectoryAliases, org.eclipse.jetty.server.handler.ContextHandler.Availability, org.eclipse.jetty.server.handler.ContextHandler.ContextScopeListener, org.eclipse.jetty.server.handler.ContextHandler.ContextStatus, org.eclipse.jetty.server.handler.ContextHandler.StaticContextNested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
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.Graceful
org.eclipse.jetty.util.component.Graceful.ShutdownNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]static final String[]static final Stringstatic final String[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.eclipse.jetty.servlet.ServletContextHandler
_defaultSecurityHandlerClass, _gzipHandler, _jspConfig, _objFactory, _options, _securityHandler, _servletHandler, _sessionHandler, GZIP, NO_SECURITY, NO_SESSIONS, SECURITY, SESSIONSFields inherited from class org.eclipse.jetty.server.handler.ContextHandler
_contextStatus, _scontext, DEFAULT_LISTENER_TYPE_INDEX, DEFAULT_MAX_FORM_CONTENT_SIZE, DEFAULT_MAX_FORM_KEYS, EXTENDED_LISTENER_TYPE_INDEX, MANAGED_ATTRIBUTES, MAX_FORM_CONTENT_SIZE_KEY, MAX_FORM_KEYS_KEY, SERVLET_LISTENER_TYPES, SERVLET_MAJOR_VERSION, SERVLET_MINOR_VERSIONFields inherited from class org.eclipse.jetty.server.handler.ScopedHandler
_nextScope, _outerScopeFields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
_handlerFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionWebAppContext(String webApp, String contextPath) WebAppContext(org.eclipse.jetty.server.HandlerContainer parent, String webApp, String contextPath) WebAppContext(org.eclipse.jetty.server.HandlerContainer parent, String contextPath, org.eclipse.jetty.server.session.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, ServletHandler servletHandler, org.eclipse.jetty.server.handler.ErrorHandler errorHandler, int options) This constructor is used in the geronimo integration.WebAppContext(org.eclipse.jetty.server.HandlerContainer parent, org.eclipse.jetty.util.resource.Resource webApp, String contextPath) WebAppContext(org.eclipse.jetty.server.session.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, ServletHandler servletHandler, org.eclipse.jetty.server.handler.ErrorHandler errorHandler) This constructor is used in the geronimo integration.WebAppContext(org.eclipse.jetty.util.resource.Resource webApp, String contextPath) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOverrideDescriptor(String overrideDescriptor) The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xmlvoidaddServerClass(String classOrPackageOrLocation) Deprecated.static voidaddServerClasses(org.eclipse.jetty.server.Server server, String... pattern) voidaddSystemClass(String classOrPackage) Deprecated.static voidaddSystemClasses(org.eclipse.jetty.server.Server server, String... pattern) voidvoiddestroy()protected voiddoStart()protected voiddoStop()voiddump(Appendable out, String indent) String[]static WebAppContextstatic String[]The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xmlString[]String[]The 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.xmlorg.eclipse.jetty.util.resource.ResourcegetResource(String uriInContext) getResourceAlias(String path) String[]String[]Get an exception that caused the webapp to be unavailablegetWar()org.eclipse.jetty.util.resource.ResourcebooleanbooleanIs the context Automatically configured.booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisServerClass(Class<?> clazz) booleanisServerClass(String name) Deprecated.booleanisServerResource(String name, URL parentUrl) booleanisSystemClass(Class<?> clazz) booleanisSystemClass(String name) Deprecated.booleanisSystemResource(String name, URL webappUrl) booleanprotected voidprotected voidprotected voidvoidvoidPre configure the web application.voidprependServerClass(String classOrPackage) Deprecated.voidprependSystemClass(String classOrPackage) Deprecated.voidremoveEventListener(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) 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) 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) voidsetDisplayName(String servletContextName) voidsetDistributable(boolean distributable) voidsetEventListeners(EventListener[] eventListeners) voidsetExtraClasspath(String extraClasspath) voidsetExtractWAR(boolean extractWAR) 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) voidsetPersistTempDirectory(boolean persist) If true the temp directory for this webapp will be kept when the webapp stops.voidsetResourceAlias(String alias, String uri) Set Resource Alias.voidsetResourceAliases(Map<String, String> map) voidsetServer(org.eclipse.jetty.server.Server server) voidsetServerClasses(String[] serverClasses) Set the server classes patterns.setServletSecurity(javax.servlet.ServletRegistration.Dynamic registration, javax.servlet.ServletSecurityElement servletSecurityElement) voidsetSystemClasses(String[] systemClasses) Set the system classes patterns.voidsetTempDirectory(File dir) Set temporary directory for context.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 voidprotected voidprotected voidtoString()Methods inherited from class org.eclipse.jetty.servlet.ServletContextHandler
addDecorator, addEventListener, addFilter, addFilter, addFilter, addRoles, addServlet, addServlet, addServlet, callContextDestroyed, callContextInitialized, dynamicHolderAdded, getDecorators, getDefaultSecurityHandlerClass, getGzipHandler, getObjectFactory, getSecurityHandler, getServletContextHandler, getServletHandler, getSessionHandler, insertHandler, newSecurityHandler, newServletHandler, newSessionHandler, setDecorators, setDefaultSecurityHandlerClass, setGzipHandler, setHandler, setSecurityHandler, setServletHandler, setSessionHandlerMethods inherited from class org.eclipse.jetty.server.handler.ContextHandler
addAliasCheck, addLocaleEncoding, addProgrammaticListener, addVirtualHosts, checkAlias, checkContext, checkContextPath, checkVirtualHost, clearAliasChecks, clearAttributes, contextDestroyed, contextInitialized, doHandle, doScope, enterScope, exitScope, getAliasChecks, getAllowNullPathInfo, getAttribute, getAttributeNames, getAttributeNameSet, getAttributes, getBaseResource, getClassLoader, getClassPath, getContextHandler, getContextPath, getContextPathEncoded, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getMimeTypes, getProtectedTargets, getRequestContextPath, getResourceBase, getResourcePaths, getServerInfo, getServletContext, getVirtualHosts, getWelcomeFiles, handle, handle, isAvailable, isCompactPath, isDurableListener, isProgrammaticListener, isProtectedTarget, isShutdown, isUsingSecurityManager, loadClass, newResource, newResource, newResource, removeAttribute, removeVirtualHosts, requestDestroyed, requestInitialized, setAliasChecks, setAllowNullPathInfo, setAttribute, setAttributes, setAvailable, setBaseResource, setCompactPath, setContextPath, setErrorHandler, setInitParameter, setLogger, setManagedAttribute, setMaxFormContentSize, setMaxFormKeys, setMimeTypes, setProtectedTargets, setResourceBase, setServerInfo, setUsingSecurityManager, setVirtualHosts, setWelcomeFiles, shutdownMethods inherited from class org.eclipse.jetty.server.handler.ScopedHandler
handle, nextHandle, nextScopeMethods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper
expandChildren, getHandler, getHandlersMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer
doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClassMethods inherited from class org.eclipse.jetty.server.handler.AbstractHandler
doError, getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stopMethods inherited from interface org.eclipse.jetty.webapp.WebAppClassLoader.Context
newResource
-
Field Details
-
TEMPDIR
- See Also:
-
BASETEMPDIR
- See Also:
-
WEB_DEFAULTS_XML
- See Also:
-
ERROR_PAGE
- See Also:
-
SERVER_SYS_CLASSES
- See Also:
-
SERVER_SRV_CLASSES
- See Also:
-
DEFAULT_CONFIGURATION_CLASSES
-
__dftSystemClasses
-
__dftServerClasses
-
-
Constructor Details
-
WebAppContext
public WebAppContext() -
WebAppContext
- Parameters:
contextPath- The context pathwebApp- The URL or filename of the webapp directory or war file.
-
WebAppContext
- Parameters:
contextPath- The context pathwebApp- The URL or filename of the webapp directory or war file.
-
WebAppContext
public WebAppContext(org.eclipse.jetty.server.HandlerContainer parent, String webApp, String contextPath) - Parameters:
parent- The parent HandlerContainer.contextPath- The context pathwebApp- The URL or filename of the webapp directory or war file.
-
WebAppContext
public WebAppContext(org.eclipse.jetty.server.HandlerContainer parent, org.eclipse.jetty.util.resource.Resource webApp, String contextPath) - Parameters:
parent- The parent HandlerContainer.contextPath- The context pathwebApp- The webapp directory or war file.
-
WebAppContext
public WebAppContext(org.eclipse.jetty.server.session.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, ServletHandler servletHandler, org.eclipse.jetty.server.handler.ErrorHandler errorHandler) This constructor is used in the geronimo integration.- 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(org.eclipse.jetty.server.HandlerContainer parent, String contextPath, org.eclipse.jetty.server.session.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, ServletHandler servletHandler, org.eclipse.jetty.server.handler.ErrorHandler errorHandler, int options) This constructor is used in the geronimo integration.- Parameters:
parent- the parent handlercontextPath- 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
-
setDisplayName
- Overrides:
setDisplayNamein classorg.eclipse.jetty.server.handler.ContextHandler- Parameters:
servletContextName- The servletContextName to set.
-
setResourceAlias
Set Resource Alias. Resource aliases map resource uri's within a context. They may optionally be used by a handler when looking for a resource.- Parameters:
alias- the alias for a resourceuri- the uri for the resource
-
getResourceAliases
-
setResourceAliases
-
getResourceAlias
-
removeResourceAlias
-
setClassLoader
- Overrides:
setClassLoaderin classorg.eclipse.jetty.server.handler.ContextHandler
-
getResource
public org.eclipse.jetty.util.resource.Resource getResource(String uriInContext) throws MalformedURLException - Overrides:
getResourcein classorg.eclipse.jetty.server.handler.ContextHandler- 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(). - Setup the default System classes by calling
loadSystemClasses() - Setup the default Server classes by calling
loadServerClasses() - Instantiates a classload (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
-
configure
- Throws:
Exception
-
postConfigure
- Throws:
Exception
-
doStart
- Overrides:
doStartin classServletContextHandler- Throws:
Exception
-
doStop
- Overrides:
doStopin classServletContextHandler- Throws:
Exception
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.eclipse.jetty.util.component.Destroyable- Specified by:
destroyin interfaceorg.eclipse.jetty.server.Handler- Overrides:
destroyin classorg.eclipse.jetty.server.handler.HandlerWrapper
-
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
@ManagedAttribute(value="web.xml deascriptors applied after standard web.xml", readonly=true) public List<String> getOverrideDescriptors()An 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 list
-
getPermissions
- Specified by:
getPermissionsin interfaceWebAppClassLoader.Context- Returns:
- Returns the permissions.
-
getServerClasses
@ManagedAttribute(value="classes and packages hidden by the context classloader", readonly=true) public String[] getServerClasses()- Returns:
- Returns the serverClasses.
- See Also:
-
getServerClasspathPattern
- Returns:
- The ClasspathPattern used to match Server (hidden) classes
-
addServerClass
Deprecated.- Parameters:
classOrPackageOrLocation- pattern (seeClasspathPattern
-
prependServerClass
Deprecated.Prepend to the list of Server classes.- Parameters:
classOrPackage- A pattern.- See Also:
-
getSystemClasses
@ManagedAttribute(value="classes and packages given priority by context classloader", readonly=true) public String[] getSystemClasses()- Returns:
- Returns the systemClasses.
- See Also:
-
getSystemClasspathPattern
- Returns:
- The ClasspathPattern used to match System (protected) classes
-
addSystemClass
Deprecated.- Parameters:
classOrPackage- pattern
-
prependSystemClass
Deprecated.Prepend to the list of System classes.- Parameters:
classOrPackage- A pattern.- See Also:
-
isServerClass
Deprecated.- Parameters:
name- class name- Returns:
- true if matched by
getServerClasspathPattern()
-
isSystemClass
Deprecated.- Parameters:
name- class name- Returns:
- true if matched by
getServerClasspathPattern()
-
isServerClass
- Specified by:
isServerClassin interfaceorg.eclipse.jetty.util.ClassVisibilityChecker
-
isSystemClass
- Specified by:
isSystemClassin interfaceorg.eclipse.jetty.util.ClassVisibilityChecker
-
isServerResource
- Specified by:
isServerResourcein interfaceWebAppClassLoader.Context
-
isSystemResource
- Specified by:
isSystemResourcein interfaceWebAppClassLoader.Context
-
loadSystemClasses
protected void loadSystemClasses() -
loadServerClasses
protected void loadServerClasses() -
getWar
- Returns:
- Returns the war as a file or URL string (Resource).
The war may be different to the @link
ContextHandler.getResourceBase()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
-
getDefaultConfigurationClasses
-
getDefaultServerClasses
-
getDefaultSystemClasses
-
loadConfigurations
- Throws:
Exception
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.server.handler.ContextHandler
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.server.handler.ContextHandler- 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.
-
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
The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml- Parameters:
overrideDescriptors- The overrideDescriptors (file or URL) to set.
-
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
- 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.
-
setEventListeners
- Overrides:
setEventListenersin classorg.eclipse.jetty.server.handler.ContextHandler
-
removeEventListener
- Overrides:
removeEventListenerin classorg.eclipse.jetty.server.handler.ContextHandler
-
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 calledContextHandler.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 forContextHandler.Context.getContext(String)
-
setServerClasses
Set the server classes patterns.Server classes/packages are classes 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. A
ClasspathPatternis used to match the server classes.- Parameters:
serverClasses- The serverClasses to set.
-
setSystemClasses
Set the system classes patterns.System classes/packages are classes provided by the JVM and that cannot be replaced by classes of the same name from WEB-INF, regardless of the value of
setParentLoaderPriority(boolean). AClasspathPatternis used to match the system classes.- Parameters:
systemClasses- The systemClasses to set.
-
setTempDirectory
Set temporary directory for context. The javax.servlet.context.tempdir attribute is also set.- Parameters:
dir- Writable temporary directory.
-
getTempDirectory
@ManagedAttribute(value="temporary directory location", readonly=true) public File getTempDirectory() -
setPersistTempDirectory
public void setPersistTempDirectory(boolean persist) If true the temp directory for this webapp will be kept when the webapp stops. Otherwise, it will be deleted.- Parameters:
persist- true to persist the temp directory on shutdown / exit of the webapp
-
isPersistTempDirectory
public boolean isPersistTempDirectory()- Returns:
- true if tmp directory will persist between startups of the webapp
-
setWar
Set the war of the webapp. From this value aContextHandler.setResourceBase(String)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 String 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
- Parameters:
extraClasspath- Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.
-
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
-
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
-
isAllowDuplicateFragmentNames
public boolean isAllowDuplicateFragmentNames() -
setAllowDuplicateFragmentNames
public void setAllowDuplicateFragmentNames(boolean allowDuplicateFragmentNames) -
startContext
- Overrides:
startContextin classServletContextHandler- Throws:
Exception
-
stopContext
- Overrides:
stopContextin classServletContextHandler- Throws:
Exception
-
startWebapp
- Throws:
Exception
-
stopWebapp
- Throws:
Exception
-
setServletSecurity
public Set<String> setServletSecurity(javax.servlet.ServletRegistration.Dynamic registration, javax.servlet.ServletSecurityElement servletSecurityElement) - Overrides:
setServletSecurityin classServletContextHandler
-
getMetaData
-
addServerClasses
-
addSystemClasses
-
getServerClasspathPattern().ClasspathPattern.add(String)