Class WebAppContext

    • Field Detail

      • BASETEMPDIR

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

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

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

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

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

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

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

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

      • WebAppContext

        public WebAppContext()
        Deprecated.
      • WebAppContext

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

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

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

        public WebAppContext​(HandlerContainer parent,
                             Resource webApp,
                             java.lang.String contextPath)
        Deprecated.
        Parameters:
        parent - The parent HandlerContainer.
        contextPath - The context path
        webApp - The webapp directory or war file.
      • WebAppContext

        public WebAppContext​(SessionHandler sessionHandler,
                             SecurityHandler securityHandler,
                             ServletHandler servletHandler,
                             ErrorHandler errorHandler)
        Deprecated.
        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​(HandlerContainer parent,
                             java.lang.String contextPath,
                             SessionHandler sessionHandler,
                             SecurityHandler securityHandler,
                             ServletHandler servletHandler,
                             ErrorHandler errorHandler,
                             int options)
        Deprecated.
        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()
        Deprecated.
      • setDisplayName

        public void setDisplayName​(java.lang.String servletContextName)
        Deprecated.
        Overrides:
        setDisplayName in class ContextHandler
        Parameters:
        servletContextName - The servletContextName to set.
      • getUnavailableException

        public java.lang.Throwable getUnavailableException()
        Deprecated.
        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)
        Deprecated.
        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()
        Deprecated.
      • setResourceAliases

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

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

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

        public void setClassLoader​(java.lang.ClassLoader classLoader)
        Deprecated.
        Overrides:
        setClassLoader in class ContextHandler
        Parameters:
        classLoader - The classLoader to set.
      • getResource

        public Resource getResource​(java.lang.String uriInContext)
                             throws java.net.MalformedURLException
        Deprecated.
        Overrides:
        getResource in class ContextHandler
        Throws:
        java.net.MalformedURLException
      • isConfigurationDiscovered

        public boolean isConfigurationDiscovered()
        Deprecated.
        Is the context Automatically configured.
        Returns:
        true if configuration discovery.
      • setConfigurationDiscovered

        public void setConfigurationDiscovered​(boolean discovered)
        Deprecated.
        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
        Deprecated.
        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
        Deprecated.
        Throws:
        java.lang.Exception
      • postConfigure

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

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

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

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

        public ClasspathPattern getServerClasspathPattern()
        Deprecated.
        Returns:
        The ClasspathPattern used to match Server (hidden) classes
      • getSystemClasspathPattern

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

        public boolean isServerClass​(java.lang.Class<?> clazz)
        Deprecated.
        Description copied from interface: ClassVisibilityChecker
        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 ClassVisibilityChecker
        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)
        Deprecated.
        Description copied from interface: ClassVisibilityChecker
        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 ClassVisibilityChecker
        Parameters:
        clazz - The fully qualified name of the class.
        Returns:
        True if the class is a system class.
      • getWebInf

        public Resource getWebInf()
                           throws java.io.IOException
        Deprecated.
        Throws:
        java.io.IOException
      • isDistributable

        @ManagedAttribute("web application distributable")
        public boolean isDistributable()
        Deprecated.
        Returns:
        Returns the distributable.
      • isCopyWebDir

        @ManagedAttribute(value="webdir copied on deploy (allows hot replacement on windows)",
                          readonly=true)
        public boolean isCopyWebDir()
        Deprecated.
        Returns:
        True if the webdir is copied (to allow hot replacement of jars on windows)
      • isCopyWebInf

        public boolean isCopyWebInf()
        Deprecated.
        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()
        Deprecated.
        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()
        Deprecated.
      • getDefaultServerClasses

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

        public java.lang.String[] getDefaultSystemClasses()
        Deprecated.
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Deprecated.
        Description copied from interface: Dumpable
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Specified by:
        dump in interface Dumpable
        Overrides:
        dump in class ContextHandler
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable
      • setConfigurationClasses

        public void setConfigurationClasses​(java.lang.String[] configurations)
        Deprecated.
        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)
        Deprecated.
      • setConfigurations

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

        public void setDefaultsDescriptor​(java.lang.String defaultsDescriptor)
        Deprecated.
        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)
        Deprecated.
        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)
        Deprecated.
        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)
        Deprecated.
        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()
        Deprecated.
        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)
        Deprecated.
        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)
        Deprecated.
        Parameters:
        distributable - The distributable to set.
      • setExtractWAR

        public void setExtractWAR​(boolean extractWAR)
        Deprecated.
        Parameters:
        extractWAR - True if war files are extracted
      • setCopyWebDir

        public void setCopyWebDir​(boolean copy)
        Deprecated.
        Parameters:
        copy - True if the webdir is copied (to allow hot replacement of jars)
      • setCopyWebInf

        public void setCopyWebInf​(boolean copyWebInf)
        Deprecated.
        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)
        Deprecated.
        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)
        Deprecated.
        Parameters:
        permissions - The permissions to set.
      • setContextWhiteList

        public void setContextWhiteList​(java.lang.String[] contextWhiteList)
        Deprecated.
        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)
        Deprecated.
        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)
        Deprecated.
        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)
        Deprecated.
        Set temporary directory for context. The javax.servlet.context.tempdir attribute is also set.
        Parameters:
        dir - Writable temporary directory.
      • setPersistTempDirectory

        public void setPersistTempDirectory​(boolean persist)
        Deprecated.
        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()
        Deprecated.
        Returns:
        true if tmp directory will persist between startups of the webapp
      • setWar

        public void setWar​(java.lang.String war)
        Deprecated.
        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​(Resource war)
        Deprecated.
        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()
        Deprecated.
        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)
        Deprecated.
        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()
        Deprecated.
      • setLogUrlOnStart

        public void setLogUrlOnStart​(boolean logOnStart)
        Deprecated.
        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()
        Deprecated.
      • setAllowDuplicateFragmentNames

        public void setAllowDuplicateFragmentNames​(boolean allowDuplicateFragmentNames)
        Deprecated.
      • setThrowUnavailableOnStartupException

        public void setThrowUnavailableOnStartupException​(boolean throwIfStartupException)
        Deprecated.
      • isThrowUnavailableOnStartupException

        public boolean isThrowUnavailableOnStartupException()
        Deprecated.
      • setServletSecurity

        public java.util.Set<java.lang.String> setServletSecurity​(ServletRegistration.Dynamic registration,
                                                                  ServletSecurityElement servletSecurityElement)
        Deprecated.
        Description copied from class: ServletContextHandler
        Delegate for ServletRegistration.Dynamic.setServletSecurity method
        Overrides:
        setServletSecurity in class ServletContextHandler
        Parameters:
        registration - ServletRegistration.Dynamic instance that setServletSecurity was called on
        servletSecurityElement - new security info
        Returns:
        the set of exact URL mappings currently associated with the registration that are also present in the web.xml security constraints and thus will be unaffected by this call.
      • getMetaData

        public MetaData getMetaData()
        Deprecated.
      • addServerClasses

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

        public static void addSystemClasses​(Server server,
                                            java.lang.String... pattern)
        Deprecated.