Class WebAppContext

  • All Implemented Interfaces:
    org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.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.Graceful, org.eclipse.jetty.util.component.LifeCycle, WebAppClassLoader.Context

    @ManagedObject("Web Application ContextHandler")
    public class WebAppContext
    extends org.eclipse.jetty.servlet.ServletContextHandler
    implements WebAppClassLoader.Context
    Web Application Context Handler.

    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 Classes 
      Modifier and Type Class Description
      class  WebAppContext.Context  
      • Nested classes/interfaces inherited from class org.eclipse.jetty.servlet.ServletContextHandler

        org.eclipse.jetty.servlet.ServletContextHandler.Decorator, org.eclipse.jetty.servlet.ServletContextHandler.JspConfig, org.eclipse.jetty.servlet.ServletContextHandler.JspPropertyGroup, org.eclipse.jetty.servlet.ServletContextHandler.ServletContainerInitializerCaller, org.eclipse.jetty.servlet.ServletContextHandler.TagLib
      • Nested 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.StaticContext
      • Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful

        org.eclipse.jetty.util.component.Graceful.Shutdown
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String[] __dftServerClasses  
      static java.lang.String[] __dftSystemClasses  
      static java.lang.String BASETEMPDIR  
      static java.lang.String[] DEFAULT_CONFIGURATION_CLASSES  
      static java.lang.String ERROR_PAGE  
      static java.lang.String SERVER_SRV_CLASSES  
      static java.lang.String SERVER_SYS_CLASSES  
      static java.lang.String TEMPDIR  
      static java.lang.String WEB_DEFAULTS_XML  
      • Fields inherited from class org.eclipse.jetty.servlet.ServletContextHandler

        _defaultSecurityHandlerClass, _gzipHandler, _jspConfig, _objFactory, _options, _securityHandler, _servletHandler, _sessionHandler, GZIP, NO_SECURITY, NO_SESSIONS, SECURITY, SESSIONS
      • Fields inherited from class org.eclipse.jetty.server.handler.ContextHandler

        _scontext, DEFAULT_LISTENER_TYPE_INDEX, EXTENDED_LISTENER_TYPE_INDEX, MANAGED_ATTRIBUTES, SERVLET_LISTENER_TYPES, SERVLET_MAJOR_VERSION, SERVLET_MINOR_VERSION
      • Fields inherited from class org.eclipse.jetty.server.handler.ScopedHandler

        _nextScope, _outerScope
      • Fields inherited from class org.eclipse.jetty.server.handler.HandlerWrapper

        _handler
      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      WebAppContext()  
      WebAppContext​(java.lang.String webApp, java.lang.String contextPath)  
      WebAppContext​(org.eclipse.jetty.server.HandlerContainer parent, java.lang.String webApp, java.lang.String contextPath)  
      WebAppContext​(org.eclipse.jetty.server.HandlerContainer parent, java.lang.String contextPath, org.eclipse.jetty.server.session.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, org.eclipse.jetty.servlet.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, java.lang.String contextPath)  
      WebAppContext​(org.eclipse.jetty.server.session.SessionHandler sessionHandler, org.eclipse.jetty.security.SecurityHandler securityHandler, org.eclipse.jetty.servlet.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, java.lang.String contextPath)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addOverrideDescriptor​(java.lang.String overrideDescriptor)
      The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
      void addServerClass​(java.lang.String classOrPackageOrLocation)
      static void addServerClasses​(org.eclipse.jetty.server.Server server, java.lang.String... pattern)  
      void addSystemClass​(java.lang.String classOrPackage)
      static void addSystemClasses​(org.eclipse.jetty.server.Server server, java.lang.String... pattern)  
      void configure()  
      void destroy()  
      protected void doStart()  
      protected void doStop()  
      void dump​(java.lang.Appendable out, java.lang.String indent)  
      java.lang.String[] getConfigurationClasses()  
      Configuration[] getConfigurations()  
      static WebAppContext getCurrentWebAppContext()  
      static java.lang.String[] getDefaultConfigurationClasses()  
      java.lang.String getDefaultsDescriptor()
      The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml
      java.lang.String[] getDefaultServerClasses()  
      java.lang.String[] getDefaultSystemClasses()  
      java.lang.String getDescriptor()  
      java.lang.String getExtraClasspath()  
      MetaData getMetaData()  
      java.lang.String getOverrideDescriptor()
      The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
      java.util.List<java.lang.String> getOverrideDescriptors()
      An override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
      java.security.PermissionCollection getPermissions()  
      org.eclipse.jetty.util.resource.Resource getResource​(java.lang.String uriInContext)  
      java.lang.String getResourceAlias​(java.lang.String path)  
      java.util.Map<java.lang.String,​java.lang.String> getResourceAliases()  
      java.lang.String[] getServerClasses()  
      ClasspathPattern getServerClasspathPattern()  
      java.lang.String[] getSystemClasses()  
      ClasspathPattern getSystemClasspathPattern()  
      java.io.File getTempDirectory()  
      java.lang.Throwable getUnavailableException()
      Get an exception that caused the webapp to be unavailable
      java.lang.String getWar()  
      org.eclipse.jetty.util.resource.Resource getWebInf()  
      boolean isAllowDuplicateFragmentNames()  
      boolean isConfigurationDiscovered()
      Is the context Automatically configured.
      boolean isCopyWebDir()  
      boolean isCopyWebInf()  
      boolean isDistributable()  
      boolean isExtractWAR()  
      boolean isLogUrlOnStart()  
      boolean isParentLoaderPriority()  
      boolean isPersistTempDirectory()  
      boolean isServerClass​(java.lang.Class<?> clazz)
      Is the class a Server Class.
      boolean isServerClass​(java.lang.String name)
      boolean isServerResource​(java.lang.String name, java.net.URL url)  
      boolean isSystemClass​(java.lang.Class<?> clazz)
      Is the class a System Class.
      boolean isSystemClass​(java.lang.String name)
      boolean isSystemResource​(java.lang.String name, java.net.URL url)  
      boolean isThrowUnavailableOnStartupException()  
      protected void loadConfigurations()  
      protected void loadServerClasses()  
      protected void loadSystemClasses()  
      void postConfigure()  
      void preConfigure()
      Pre configure the web application.
      void prependServerClass​(java.lang.String classOrPackage)
      void prependSystemClass​(java.lang.String classOrPackage)
      void removeEventListener​(java.util.EventListener listener)  
      java.lang.String removeResourceAlias​(java.lang.String alias)  
      void setAllowDuplicateFragmentNames​(boolean allowDuplicateFragmentNames)  
      void setClassLoader​(java.lang.ClassLoader classLoader)  
      void setConfigurationClasses​(java.lang.String[] configurations)  
      void setConfigurationClasses​(java.util.List<java.lang.String> configurations)  
      void setConfigurationDiscovered​(boolean discovered)
      Set the configuration discovery mode.
      void setConfigurations​(Configuration[] configurations)  
      void setContextWhiteList​(java.lang.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.
      void setCopyWebDir​(boolean copy)  
      void setCopyWebInf​(boolean copyWebInf)  
      void setDefaultsDescriptor​(java.lang.String defaultsDescriptor)
      The default descriptor is a web.xml format file that is applied to the context before the standard WEB-INF/web.xml
      void setDescriptor​(java.lang.String descriptor)  
      void setDisplayName​(java.lang.String servletContextName)  
      void setDistributable​(boolean distributable)  
      void setEventListeners​(java.util.EventListener[] eventListeners)  
      void setExtraClasspath​(java.lang.String extraClasspath)  
      void setExtractWAR​(boolean extractWAR)  
      void setLogUrlOnStart​(boolean logOnStart)
      Sets whether or not the web app name and URL is logged on startup
      void setOverrideDescriptor​(java.lang.String overrideDescriptor)
      The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
      void setOverrideDescriptors​(java.util.List<java.lang.String> overrideDescriptors)
      The override descriptor is a web.xml format file that is applied to the context after the standard WEB-INF/web.xml
      void setParentLoaderPriority​(boolean java2compliant)  
      void setPermissions​(java.security.PermissionCollection permissions)  
      void setPersistTempDirectory​(boolean persist)
      If true the temp directory for this webapp will be kept when the webapp stops.
      void setResourceAlias​(java.lang.String alias, java.lang.String uri)
      Set Resource Alias.
      void setResourceAliases​(java.util.Map<java.lang.String,​java.lang.String> map)  
      void setServer​(org.eclipse.jetty.server.Server server)  
      void setServerClasses​(java.lang.String[] serverClasses)
      Set the server classes patterns.
      java.util.Set<java.lang.String> setServletSecurity​(javax.servlet.ServletRegistration.Dynamic registration, javax.servlet.ServletSecurityElement servletSecurityElement)  
      void setSystemClasses​(java.lang.String[] systemClasses)
      Set the system classes patterns.
      void setTempDirectory​(java.io.File dir)
      Set temporary directory for context.
      void setThrowUnavailableOnStartupException​(boolean throwIfStartupException)  
      void setWar​(java.lang.String war)
      Set the war of the webapp.
      void setWarResource​(org.eclipse.jetty.util.resource.Resource war)
      Set the war of the webapp as a Resource.
      protected void startContext()  
      protected void startWebapp()  
      protected void stopContext()  
      protected void stopWebapp()  
      java.lang.String toString()  
      • 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, getServletHandler, getSessionHandler, insertHandler, newSecurityHandler, newServletHandler, newSessionHandler, setDecorators, setDefaultSecurityHandlerClass, setGzipHandler, setHandler, setSecurityHandler, setServletHandler, setSessionHandler
      • Methods inherited from class org.eclipse.jetty.server.handler.ContextHandler

        addAliasCheck, addLocaleEncoding, addProgrammaticListener, addVirtualHosts, checkAlias, checkContext, checkContextPath, checkVirtualHost, clearAliasChecks, clearAttributes, doHandle, doScope, enterScope, exitScope, getAliasChecks, getAllowNullPathInfo, getAttribute, getAttributeNames, getAttributes, getBaseResource, getClassLoader, getClassPath, getContextHandler, getContextPath, getContextPathEncoded, getCurrentContext, getDisplayName, getErrorHandler, getEventListeners, getInitParameter, getInitParameterNames, getInitParams, getLocaleEncoding, getLocaleEncoding, getLocaleEncodings, getLogger, getMaxFormContentSize, getMaxFormKeys, getMimeTypes, getProtectedTargets, getResourceBase, getResourcePaths, getServerInfo, getServletContext, getVirtualHosts, getWelcomeFiles, handle, handle, isAvailable, isCompactPath, 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, shutdown
      • Methods inherited from class org.eclipse.jetty.server.handler.ScopedHandler

        handle, nextHandle, nextScope
      • Methods inherited from class org.eclipse.jetty.server.handler.HandlerWrapper

        expandChildren, getHandler, getHandlers
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer

        doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        doError, getServer
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, 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, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
      • Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

        addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
    • Field Detail

      • WEB_DEFAULTS_XML

        public static final java.lang.String WEB_DEFAULTS_XML
        See Also:
        Constant Field Values
      • SERVER_SYS_CLASSES

        public static final java.lang.String SERVER_SYS_CLASSES
        See Also:
        Constant Field Values
      • SERVER_SRV_CLASSES

        public static final java.lang.String SERVER_SRV_CLASSES
        See Also:
        Constant Field Values
      • DEFAULT_CONFIGURATION_CLASSES

        public static final java.lang.String[] DEFAULT_CONFIGURATION_CLASSES
      • __dftSystemClasses

        public static final java.lang.String[] __dftSystemClasses
      • __dftServerClasses

        public static final java.lang.String[] __dftServerClasses
    • Constructor Detail

      • WebAppContext

        public WebAppContext()
      • WebAppContext

        public WebAppContext​(java.lang.String webApp,
                             java.lang.String contextPath)
        Parameters:
        contextPath - The context path
        webApp - The URL or filename of the webapp directory or war file.
      • WebAppContext

        public WebAppContext​(org.eclipse.jetty.util.resource.Resource webApp,
                             java.lang.String contextPath)
        Parameters:
        contextPath - The context path
        webApp - The URL or filename of the webapp directory or war file.
      • WebAppContext

        public WebAppContext​(org.eclipse.jetty.server.HandlerContainer parent,
                             java.lang.String webApp,
                             java.lang.String contextPath)
        Parameters:
        parent - The parent HandlerContainer.
        contextPath - The context path
        webApp - 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,
                             java.lang.String contextPath)
        Parameters:
        parent - The parent HandlerContainer.
        contextPath - The context path
        webApp - The webapp directory or war file.
      • WebAppContext

        public WebAppContext​(org.eclipse.jetty.server.session.SessionHandler sessionHandler,
                             org.eclipse.jetty.security.SecurityHandler securityHandler,
                             org.eclipse.jetty.servlet.ServletHandler servletHandler,
                             org.eclipse.jetty.server.handler.ErrorHandler errorHandler)
        This constructor is used in the geronimo integration.
        Parameters:
        sessionHandler - SessionHandler for this web app
        securityHandler - SecurityHandler for this web app
        servletHandler - ServletHandler for this web app
        errorHandler - ErrorHandler for this web app
      • WebAppContext

        public WebAppContext​(org.eclipse.jetty.server.HandlerContainer parent,
                             java.lang.String contextPath,
                             org.eclipse.jetty.server.session.SessionHandler sessionHandler,
                             org.eclipse.jetty.security.SecurityHandler securityHandler,
                             org.eclipse.jetty.servlet.ServletHandler servletHandler,
                             org.eclipse.jetty.server.handler.ErrorHandler errorHandler,
                             int options)
        This constructor is used in the geronimo integration.
        Parameters:
        parent - the parent handler
        contextPath - the context path
        sessionHandler - SessionHandler for this web app
        securityHandler - SecurityHandler for this web app
        servletHandler - ServletHandler for this web app
        errorHandler - ErrorHandler for this web app
        options - the options (ServletContextHandler.SESSIONS and/or ServletContextHandler.SECURITY)
    • Method Detail

      • getCurrentWebAppContext

        public static WebAppContext getCurrentWebAppContext()
      • setDisplayName

        public void setDisplayName​(java.lang.String servletContextName)
        Overrides:
        setDisplayName in class org.eclipse.jetty.server.handler.ContextHandler
        Parameters:
        servletContextName - The servletContextName to set.
      • getUnavailableException

        public java.lang.Throwable getUnavailableException()
        Get an exception that caused the webapp to be unavailable
        Returns:
        A throwable if the webapp is unavailable or null
      • setResourceAlias

        public void setResourceAlias​(java.lang.String alias,
                                     java.lang.String uri)
        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 resource
        uri - the uri for the resource
      • getResourceAliases

        public java.util.Map<java.lang.String,​java.lang.String> getResourceAliases()
      • setResourceAliases

        public void setResourceAliases​(java.util.Map<java.lang.String,​java.lang.String> map)
      • getResourceAlias

        public java.lang.String getResourceAlias​(java.lang.String path)
      • removeResourceAlias

        public java.lang.String removeResourceAlias​(java.lang.String alias)
      • setClassLoader

        public void setClassLoader​(java.lang.ClassLoader classLoader)
        Overrides:
        setClassLoader in class org.eclipse.jetty.server.handler.ContextHandler
      • getResource

        public org.eclipse.jetty.util.resource.Resource getResource​(java.lang.String uriInContext)
                                                             throws java.net.MalformedURLException
        Overrides:
        getResource in class org.eclipse.jetty.server.handler.ContextHandler
        Throws:
        java.net.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

        public void preConfigure()
                          throws java.lang.Exception
        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:

        Throws:
        java.lang.Exception - if unable to pre configure
      • configure

        public void configure()
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • postConfigure

        public void postConfigure()
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.servlet.ServletContextHandler
        Throws:
        java.lang.Exception
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Overrides:
        doStop in class org.eclipse.jetty.servlet.ServletContextHandler
        Throws:
        java.lang.Exception
      • destroy

        public void destroy()
        Specified by:
        destroy in interface org.eclipse.jetty.util.component.Destroyable
        Specified by:
        destroy in interface org.eclipse.jetty.server.Handler
        Overrides:
        destroy in class org.eclipse.jetty.server.handler.HandlerWrapper
      • getConfigurationClasses

        @ManagedAttribute(value="configuration classes used to configure webapp",
                          readonly=true)
        public java.lang.String[] getConfigurationClasses()
        Returns:
        Returns the configurations.
      • getConfigurations

        public Configuration[] getConfigurations()
        Returns:
        Returns the configurations.
      • getDefaultsDescriptor

        @ManagedAttribute(value="default web.xml deascriptor applied before standard web.xml",
                          readonly=true)
        public java.lang.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

        public java.lang.String 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 java.util.List<java.lang.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
      • getServerClasses

        @ManagedAttribute(value="classes and packages hidden by the context classloader",
                          readonly=true)
        public java.lang.String[] getServerClasses()
        Returns:
        Returns the serverClasses.
        See Also:
        setServerClasses(String[])
      • getServerClasspathPattern

        public ClasspathPattern getServerClasspathPattern()
        Returns:
        The ClasspathPattern used to match Server (hidden) classes
      • getSystemClasses

        @ManagedAttribute(value="classes and packages given priority by context classloader",
                          readonly=true)
        public java.lang.String[] getSystemClasses()
        Returns:
        Returns the systemClasses.
        See Also:
        setSystemClasses(String[])
      • getSystemClasspathPattern

        public ClasspathPattern getSystemClasspathPattern()
        Returns:
        The ClasspathPattern used to match System (protected) classes
      • isServerClass

        public boolean isServerClass​(java.lang.Class<?> clazz)
        Description copied from interface: WebAppClassLoader.Context
        Is the class a Server Class. A Server class is a class that is part of the implementation of the server and is NIT visible to a webapplication. The web application may provide it's own implementation of the class, to be loaded from WEB-INF/lib or WEB-INF/classes
        Specified by:
        isServerClass in interface WebAppClassLoader.Context
        Parameters:
        clazz - The fully qualified name of the class.
        Returns:
        True if the class is a server class.
      • isSystemClass

        public boolean isSystemClass​(java.lang.Class<?> clazz)
        Description copied from interface: WebAppClassLoader.Context
        Is the class a System Class. A System class is a class that is visible to a webapplication, but that cannot be overridden by the contents of WEB-INF/lib or WEB-INF/classes
        Specified by:
        isSystemClass in interface WebAppClassLoader.Context
        Parameters:
        clazz - The fully qualified name of the class.
        Returns:
        True if the class is a system class.
      • loadSystemClasses

        protected void loadSystemClasses()
      • loadServerClasses

        protected void loadServerClasses()
      • getWar

        @ManagedAttribute(value="war file location",
                          readonly=true)
        public java.lang.String 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

        public org.eclipse.jetty.util.resource.Resource getWebInf()
                                                           throws java.io.IOException
        Throws:
        java.io.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:
        isParentLoaderPriority in interface WebAppClassLoader.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

        public static java.lang.String[] getDefaultConfigurationClasses()
      • getDefaultServerClasses

        public java.lang.String[] getDefaultServerClasses()
      • getDefaultSystemClasses

        public java.lang.String[] getDefaultSystemClasses()
      • loadConfigurations

        protected void loadConfigurations()
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class org.eclipse.jetty.server.handler.ContextHandler
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Specified by:
        dump in interface org.eclipse.jetty.util.component.Dumpable
        Overrides:
        dump in class org.eclipse.jetty.server.handler.ContextHandler
        Throws:
        java.io.IOException
      • setConfigurationClasses

        public void setConfigurationClasses​(java.lang.String[] configurations)
        Parameters:
        configurations - The configuration class names. If setConfigurations is not called these classes are used to create a configurations array.
      • setConfigurationClasses

        public void setConfigurationClasses​(java.util.List<java.lang.String> configurations)
      • setConfigurations

        public void setConfigurations​(Configuration[] configurations)
        Parameters:
        configurations - The configurations to set.
      • setDefaultsDescriptor

        public void setDefaultsDescriptor​(java.lang.String defaultsDescriptor)
        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

        public void setOverrideDescriptor​(java.lang.String overrideDescriptor)
        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

        public void setOverrideDescriptors​(java.util.List<java.lang.String> overrideDescriptors)
        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

        public void addOverrideDescriptor​(java.lang.String overrideDescriptor)
        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

        @ManagedAttribute(value="standard web.xml descriptor",
                          readonly=true)
        public java.lang.String getDescriptor()
        Returns:
        the web.xml descriptor to use. If set to null, WEB-INF/web.xml is used if it exists.
      • setDescriptor

        public void setDescriptor​(java.lang.String descriptor)
        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

        public void setEventListeners​(java.util.EventListener[] eventListeners)
        Overrides:
        setEventListeners in class org.eclipse.jetty.server.handler.ContextHandler
      • removeEventListener

        public void removeEventListener​(java.util.EventListener listener)
        Overrides:
        removeEventListener in class org.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

        public void setPermissions​(java.security.PermissionCollection permissions)
        Parameters:
        permissions - The permissions to set.
      • setContextWhiteList

        public void setContextWhiteList​(java.lang.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. Setting this white list will enable a check when a servlet called ContextHandler.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 for ContextHandler.Context.getContext(String)
      • setServerClasses

        public void setServerClasses​(java.lang.String[] serverClasses)
        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 ClasspathPattern is used to match the server classes.

        Parameters:
        serverClasses - The serverClasses to set.
      • setSystemClasses

        public void setSystemClasses​(java.lang.String[] systemClasses)
        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). A ClasspathPattern is used to match the system classes.

        Parameters:
        systemClasses - The systemClasses to set.
      • setTempDirectory

        public void setTempDirectory​(java.io.File dir)
        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 java.io.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

        public void setWar​(java.lang.String war)
        Set the war of the webapp. From this value a ContextHandler.setResourceBase(String) value is computed by WebInfConfiguration, 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 a Resource.
        Parameters:
        war - The war to set as a Resource.
        See Also:
        setWar(String)
      • getExtraClasspath

        @ManagedAttribute(value="extra classpath for context classloader",
                          readonly=true)
        public java.lang.String getExtraClasspath()
        Specified by:
        getExtraClasspath in interface WebAppClassLoader.Context
        Returns:
        Comma or semicolon separated path of filenames or URLs pointing to directories or jar files. Directories should end with '/'.
      • setExtraClasspath

        public void setExtraClasspath​(java.lang.String extraClasspath)
        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:
        setServer in interface org.eclipse.jetty.server.Handler
        Overrides:
        setServer in class org.eclipse.jetty.server.handler.ContextHandler
      • isAllowDuplicateFragmentNames

        public boolean isAllowDuplicateFragmentNames()
      • setAllowDuplicateFragmentNames

        public void setAllowDuplicateFragmentNames​(boolean allowDuplicateFragmentNames)
      • setThrowUnavailableOnStartupException

        public void setThrowUnavailableOnStartupException​(boolean throwIfStartupException)
      • isThrowUnavailableOnStartupException

        public boolean isThrowUnavailableOnStartupException()
      • startContext

        protected void startContext()
                             throws java.lang.Exception
        Overrides:
        startContext in class org.eclipse.jetty.servlet.ServletContextHandler
        Throws:
        java.lang.Exception
      • stopContext

        protected void stopContext()
                            throws java.lang.Exception
        Overrides:
        stopContext in class org.eclipse.jetty.servlet.ServletContextHandler
        Throws:
        java.lang.Exception
      • startWebapp

        protected void startWebapp()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • stopWebapp

        protected void stopWebapp()
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setServletSecurity

        public java.util.Set<java.lang.String> setServletSecurity​(javax.servlet.ServletRegistration.Dynamic registration,
                                                                  javax.servlet.ServletSecurityElement servletSecurityElement)
        Overrides:
        setServletSecurity in class org.eclipse.jetty.servlet.ServletContextHandler
      • getMetaData

        public MetaData getMetaData()
      • addServerClasses

        public static void addServerClasses​(org.eclipse.jetty.server.Server server,
                                            java.lang.String... pattern)
      • addSystemClasses

        public static void addSystemClasses​(org.eclipse.jetty.server.Server server,
                                            java.lang.String... pattern)