Top Description Inners Fields Constructors Methods
org.apache.catalina.core

public Class StandardContext

extends ContainerBase
implements Context, NotificationEmitter
Class Inheritance
All Implemented Interfaces
javax.management.NotificationEmitter, javax.management.NotificationBroadcaster, org.apache.catalina.Context, org.apache.tomcat.ContextBind, org.apache.catalina.Container, org.apache.catalina.Lifecycle
Imports
java.io.File, .IOException, .InputStream, java.net.MalformedURLException, .URL, java.nio.charset.StandardCharsets, java.security.AccessController, .PrivilegedAction, java.util.ArrayDeque, .ArrayList, .Arrays, .Collection, .Deque, .Enumeration, .EventListener, .HashMap, .HashSet, .LinkedHashMap, .List, .Locale, .Map, .Map.Entry, .Set, .TreeMap, java.util.concurrent.ConcurrentHashMap, .CopyOnWriteArrayList, java.util.concurrent.atomic.AtomicLong, java.util.concurrent.locks.Lock, .ReadWriteLock, .ReentrantReadWriteLock, javax.management.ListenerNotFoundException, .MBeanNotificationInfo, .Notification, .NotificationBroadcasterSupport, .NotificationEmitter, .NotificationFilter, .NotificationListener, javax.naming.NamingException, jakarta.servlet.Filter, .FilterConfig, .FilterRegistration, .RequestDispatcher, .Servlet, .ServletContainerInitializer, .ServletContext, .ServletContextAttributeListener, .ServletContextEvent, .ServletContextListener, .ServletException, .ServletRegistration, .ServletRegistration.Dynamic, .ServletRequest, .ServletRequestAttributeListener, .ServletRequestEvent, .ServletRequestListener, .ServletSecurityElement, .SessionCookieConfig, .SessionTrackingMode, jakarta.servlet.descriptor.JspConfigDescriptor, jakarta.servlet.http.HttpSessionAttributeListener, .HttpSessionIdListener, .HttpSessionListener, org.apache.catalina.Authenticator, .Container, .ContainerListener, .Context, .CredentialHandler, .Globals, .Lifecycle, .LifecycleException, .LifecycleListener, .LifecycleState, .Loader, .Manager, .Pipeline, .Realm, .ThreadBindingListener, .Valve, .WebResource, .WebResourceRoot, .Wrapper, org.apache.catalina.deploy.NamingResourcesImpl, org.apache.catalina.loader.WebappClassLoaderBase, .WebappLoader, org.apache.catalina.session.StandardManager, org.apache.catalina.util.CharsetMapper, .ContextName, .ErrorPageSupport, .URLEncoder, org.apache.catalina.webresources.StandardRoot, org.apache.juli.logging.Log, .LogFactory, org.apache.naming.ContextBindings, org.apache.tomcat.InstanceManager, .InstanceManagerBindings, .JarScanner, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.buf.StringUtils, org.apache.tomcat.util.compat.JreCompat, org.apache.tomcat.util.descriptor.XmlIdentifiers, org.apache.tomcat.util.descriptor.web.ApplicationParameter, .ErrorPage, .FilterDef, .FilterMap, .Injectable, .InjectionTarget, .LoginConfig, .MessageDestination, .SecurityCollection, .SecurityConstraint, org.apache.tomcat.util.http.CookieProcessor, .Rfc6265CookieProcessor, org.apache.tomcat.util.scan.StandardJarScanner, org.apache.tomcat.util.security.PrivilegedGetTccl, .PrivilegedSetTccl, org.apache.tomcat.util.threads.ScheduledThreadPoolExecutor

Standard implementation of the Context interface. Each child container must be a Wrapper implementation to process the requests directed to a particular servlet.
Authors
Craig R. McClanahan, Remy Maucherat

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
StandardContext.ContextFilterMaps

A helper class to manage the filter mappings in a Context.

private static class

Field Summary

Modifier and TypeField and Description
private boolean
protected boolean
allowCasualMultipartParsing

Allow multipart/form-data requests to be parsed even when the target servlet doesn't specify @MultipartConfig or have a <multipart-config> element.

private boolean
private String
altDDName

The alternate deployment descriptor name.

private boolean
private boolean
antiResourceLocking

The antiResourceLocking flag for this Context.

private List<Object>
applicationEventListenersList

The list of instantiated application event listener objects.

private Object[]
applicationLifecycleListenersObjects

The set of instantiated application lifecycle listener objects.

private CopyOnWriteArrayList<String>
applicationListeners

The list of unique application listener class names configured for this application, in the order they were encountered in the resulting merged web.xml file.

private ApplicationParameter[]
applicationParameters

The set of application parameters defined for this application.

private final Object
private NotificationBroadcasterSupport
broadcaster

The broadcaster that sends j2ee notifications.

private CharsetMapper
charsetMapper

The Locale to character set mapper for this application.

private String
charsetMapperClass

The Java class name of the CharsetMapper class to be created.

private boolean
clearReferencesHttpClientKeepAliveThread

If an HttpClient keep-alive timer thread has been started by this web application and is still running, should Tomcat change the context class loader from the current ClassLoader to ClassLoader#getParent() to prevent a memory leak?

private boolean
clearReferencesObjectStreamClassCaches

Should Tomcat attempt to clear references to classes loaded by the web application class loader from the ObjectStreamClass caches?

private boolean
clearReferencesRmiTargets

Enables the RMI Target memory leak detection to be controlled.

private boolean
clearReferencesStopThreads

Should Tomcat attempt to terminate threads that have been started by the web application?

private boolean
clearReferencesStopTimerThreads

Should Tomcat attempt to terminate any java.util.TimerThreads that have been started by the web application?

private boolean
clearReferencesThreadLocals

Should Tomcat attempt to clear references to classes loaded by this class loader from ThreadLocals?

private URL
configFile

The URL of the XML descriptor for this context.

private boolean
configured

The "correctly configured" flag for this Context.

private volatile SecurityConstraint[]
constraints

The security constraints for this web application.

private final Object
private String
protected ApplicationContext
context

The ServletContext implementation associated with this Context.

private boolean
private CookieProcessor
private boolean
cookies

Should we attempt to use cookies for session id communication?

private boolean
copyXML

Context level override for default StandardHost#isCopyXML().

private Set<Servlet>
createdServlets

Servlets created via ApplicationContext#createServlet(Class) for tracking purposes.

private boolean
private boolean
crossContext

Should we allow the ServletContext.getContext() method to access the context of other web applications in this server?

protected static final ThreadBindingListener
private String
defaultContextXml

Override the default context xml location.

private String
defaultWebXml

Override the default web xml location.

private boolean
delegate

The "follow standard delegation model" flag that will be used to configure our ClassLoader.

private boolean
private boolean
private boolean
private String
displayName

The display name of this web application.

private boolean
distributable

The distributable flag for this web application.

private String
docBase

The document root for this web application.

private int
private int
private String
encodedPath

Encoded path.

private final ErrorPageSupport
private Boolean
private Map<String, ApplicationFilterConfig>
filterConfigs

The set of filter configurations (and associated filter instances) we have initialized, keyed by filter name.

private Map<String, FilterDef>
filterDefs

The set of filter definitions for this application, keyed by filter name.

private final StandardContext.ContextFilterMaps
filterMaps

The set of filter mappings for this application, in the order they were defined in the deployment descriptor with additional mappings added via the ServletContext possibly both before and after those defined in the deployment descriptor.

private boolean
private boolean
ignoreAnnotations

Ignore annotations.

private Map<ServletContainerInitializer, Set<Class<?>>>
initializers

The ordered set of ServletContainerInitializers for this web application.

private final AtomicLong
private InstanceManager
instanceManager

Lifecycle provider.

private String
j2EEApplication

Name of the engine.

private String
private JarScanner
jarScanner

The Jar scanner to use to search for Jars that might contain configuration information such as TLDs or web-fragment.xml files.

private boolean
private JspConfigDescriptor
private Loader
loader

The Loader implementation with which this Container is associated.

private final ReadWriteLock
private static final Log
private boolean
logEffectiveWebXml

Should the effective web.xml be logged when the context starts?

private LoginConfig
loginConfig

The login configuration descriptor for this web application.

protected Manager
manager

The Manager implementation with which this Container is associated.

private final ReadWriteLock
private boolean
private boolean
private HashMap<String, MessageDestination>
messageDestinations

The message destinations for this web application.

private Map<String, String>
mimeMappings

The MIME mappings for this web application, keyed by extension.

private NamingContextListener
namingContextListener

The naming context listener for this web application.

private String
namingContextName

Name of the associated naming context.

private NamingResourcesImpl
namingResources

The naming resources for this web application.

private final Object
private final Set<Object>
noPluggabilityListeners

The set of application listeners that are required to have limited access to ServletContext methods.

private StandardContext.NoPluggabilityServletContext
noPluggabilityServletContext

The wrapped version of the associated ServletContext that is presented to listeners that are required to have limited access to ServletContext methods.

private MBeanNotificationInfo[]
private String
originalDocBase

The original document root for this web application.

private boolean
override

The default context override flag for this web application.

private boolean
private final Map<String, String>
parameters

The context initialization parameters for this web application, keyed by name.

private String
path

Unencoded path for this web application.

private volatile boolean
paused

The request processing pause flag (while reloading occurs)

private Map<String, String>
private Map<String, String>
private boolean
private boolean
privileged

The privileged flag for this web application.

private String
publicId

The public identifier of the DTD for the web application deployment descriptor version we are currently parsing.

private boolean
reloadable

The reloadable flag for this web application.

private boolean
renewThreadsWhenStoppingContext

Should Tomcat renew the threads of the thread pool when the application is stopped to avoid memory leaks because of uncleaned ThreadLocal variables.

private boolean
replaceWelcomeFiles

Should the next call to addWelcomeFile() cause replacement of any existing welcome files?

private String
private Set<String>
private WebResourceRoot
private final ReadWriteLock
private String
private Map<String, String>
roleMappings

The security role mappings for this application, keyed by role name (as used within the application).

private String[]
securityRoles

The security roles for this application, keyed by role name.

private final Object
private boolean
private AtomicLong
sequenceNumber

The notification sequence number.

private String
server

The J2EE Server ObjectName this module is deployed on.

private Map<String, String>
servletMappings

The servlet mappings for this web application, keyed by matching pattern.

private final Object
private String
sessionCookieDomain

The domain to use for session cookies.

private String
sessionCookieName

The name to use for session cookies.

private String
sessionCookiePath

The path to use for session cookies.

private boolean
sessionCookiePathUsesTrailingSlash

Is a / added to the end of the session cookie path to ensure browsers, particularly IE, don't send a session cookie for context /foo with requests intended for context /foobar.

private int
sessionTimeout

The session timeout (in minutes) for this web application.

private boolean
skipMemoryLeakChecksOnJvmShutdown

Should Tomcat skip the memory leak checks when the web application is stopped as part of the process of shutting down the JVM?

private long
private long
private boolean
swallowAbortedUploads

Control whether remaining request data will be read (swallowed) even if the request violates a data size constraint.

private boolean
swallowOutput

Set flag to true to cause the system.out and system.err to be redirected to the logger when executing a servlet.

protected ThreadBindingListener
private long
private boolean
tldValidation

Attribute value used to turn on/off XML validation

private long
unloadDelay

Amount of ms that the container will wait for servlets to unload.

private boolean
unpackWAR

Unpack WAR property.

private boolean
private boolean
useHttpOnly

The flag that indicates that session cookies should use HttpOnly

private boolean
useNaming

JNDI use flag.

private boolean
private boolean
private boolean
private String[]
watchedResources

The watched resources for this application.

private final Object
private String
private boolean
webXmlNamespaceAware

Attribute value used to turn on/off XML namespace validation

private boolean
webXmlValidation

Attribute value used to turn on/off XML validation for web.xml and web-fragment.xml files.

private String[]
welcomeFiles

The welcome files for this application.

private final Object
private String
workDir

The pathname to the work directory for this context (relative to the server's home if not absolute).

private Class<?>
private String
wrapperClassName

Java class name of the Wrapper class implementation we use.

private String[]
wrapperLifecycles

The set of classnames of LifecycleListeners that will be added to each newly created Wrapper by createWrapper().

private final Object
private String[]
wrapperListeners

The set of classnames of ContainerListeners that will be added to each newly created Wrapper by createWrapper().

private final Object
private boolean
xmlBlockExternal

Attribute used to turn on/off the use of external entities.

Inherited from org.apache.catalina.core.ContainerBase:
accessLogbackgroundProcessorDelaybackgroundProcessorFuturechildrenclusterlistenersloggerlogNamemonitorFuturenameparentparentClassLoaderpipelinesmstartChildrenstartStopExecutorsupport

Constructor Summary

AccessConstructor and Description
public
StandardContext()

Create a new StandardContext component with the default basic Valve.

Method Summary

Modifier and TypeMethod and Description
public void
addApplicationEventListener(Object
The listener to add
listener
)

Add a listener to the end of the list of initialized application event listeners.

public void
addApplicationLifecycleListener(Object
The listener to add
listener
)

Add a listener to the end of the list of initialized application lifecycle listeners.

public void
addApplicationListener(String
Java class name of a listener class
listener
)

Implements org.apache.catalina.Context.addApplicationListener.

Add a new Listener class name to the set of Listeners configured for this application.

public void
addApplicationParameter(ApplicationParameter
The new application parameter
parameter
)

Implements org.apache.catalina.Context.addApplicationParameter.

Add a new application parameter for this application.

public void
addChild(Container
Child container to be added
child
)

Overrides org.apache.catalina.core.ContainerBase.addChild.

Implements org.apache.catalina.Container.addChild.

Add a child Container, only if the proposed child is an implementation of Wrapper.

public void
addConstraint(SecurityConstraint
the new security constraint
constraint
)

Implements org.apache.catalina.Context.addConstraint.

Add a security constraint to the set for this web application.

public void
addErrorPage(ErrorPage
The error page definition to be added
errorPage
)

Implements org.apache.catalina.Context.addErrorPage.

Add an error page for the specified error or Java exception.

public void
addFilterDef(FilterDef
The filter definition to be added
filterDef
)

Implements org.apache.catalina.Context.addFilterDef.

Add a filter definition to this Context.

public void
addFilterMap(FilterMap
The filter mapping to be added
filterMap
)

Implements org.apache.catalina.Context.addFilterMap.

Add a filter mapping to this Context at the end of the current set of filter mappings.

public void
addFilterMapBefore(FilterMap
The filter mapping to be added
filterMap
)

Implements org.apache.catalina.Context.addFilterMapBefore.

Add a filter mapping to this Context before the mappings defined in the deployment descriptor but after any other mappings added via this method.

private void
addInjectionTarget(Injectable resource, Map<String, Map<String, String>> injectionMap)

public void
addLocaleEncodingMappingParameter(String
locale to map an encoding for
locale
,
String
encoding to be used for a give locale
encoding
)

Implements org.apache.catalina.Context.addLocaleEncodingMappingParameter.

Add a Locale Encoding Mapping (see Sec 5.4 of Servlet spec 2.4)

public void
addMessageDestination(MessageDestination
New message destination
md
)

Add a message destination for this web application.

public void
addMimeMapping(String
Filename extension being mapped
extension
,
String
Corresponding MIME type
mimeType
)

Implements org.apache.catalina.Context.addMimeMapping.

Add a new MIME mapping, replacing any existing mapping for the specified extension.

public void
addNotificationListener(NotificationListener
The listener object which will handle the notifications emitted by the broadcaster.
listener
,
NotificationFilter
The filter object. If filter is null, no filtering will be performed before handling notifications.
filter
,
Object
An opaque object to be sent back to the listener when a notification is emitted. This object cannot be used by the Notification broadcaster object. It should be resent unchanged with the notification to the listener.
object
)

Implements javax.management.NotificationBroadcaster.addNotificationListener.

Add a JMX NotificationListener

public void
addParameter(String
Name of the new parameter
name
,
String
Value of the new parameter
value
)

Implements org.apache.catalina.Context.addParameter.

Add a new context initialization parameter.

public void
addPostConstructMethod(String
Fully qualified class name
clazz
,
String
Post construct method name
method
)

Implements org.apache.catalina.Context.addPostConstructMethod.

Add a post construct method definition for the given class, if there is an existing definition for the specified class - IllegalArgumentException will be thrown.

public void
addPreDestroyMethod(String
Fully qualified class name
clazz
,
String
Post construct method name
method
)

Implements org.apache.catalina.Context.addPreDestroyMethod.

Add a pre destroy method definition for the given class, if there is an existing definition for the specified class - IllegalArgumentException will be thrown.

public void
addRoleMapping(String
Security role used in the application
role
,
String
Actual security role to check for
link
)

Implements org.apache.catalina.Context.addRoleMapping.

Add a security role reference for this web application.

public void
addSecurityRole(String
New security role
role
)

Implements org.apache.catalina.Context.addSecurityRole.

Add a new security role for this web application.

public void
addServletContainerInitializer(ServletContainerInitializer
The instance to add
sci
,
Set<Class<?>>
The classes in which the initializer expressed an interest
classes
)

Implements org.apache.catalina.Context.addServletContainerInitializer.

Add a ServletContainerInitializer instance to this web application.

public void
addServletMappingDecoded(String
URL pattern to be mapped
pattern
,
String
Name of the corresponding servlet to execute
name
,
boolean
true if name identifies the JspServlet and pattern contains a wildcard; false otherwise
jspWildCard
)

Implements org.apache.catalina.Context.addServletMappingDecoded.

Add a new servlet mapping, replacing any existing mapping for the specified pattern.

public Set<String>
addServletSecurity(ServletRegistration.Dynamic
Servlet security was modified for
registration
,
ServletSecurityElement
new security constraints for this Servlet
servletSecurityElement
)

Implements org.apache.catalina.Context.addServletSecurity.

Notification that Servlet security has been dynamically set in a jakarta.servlet.ServletRegistration.Dynamic

public void
addWatchedResource(String
New watched resource file name
name
)

Implements org.apache.catalina.Context.addWatchedResource.

Add a new watched resource to the set recognized by this Context.

public void
addWelcomeFile(String
New welcome file name
name
)

Implements org.apache.catalina.Context.addWelcomeFile.

Add a new welcome file to the set recognized by this Context.

public void
addWrapperLifecycle(String
Java class name of a LifecycleListener class
listener
)

Implements org.apache.catalina.Context.addWrapperLifecycle.

Add the classname of a LifecycleListener to be added to each Wrapper appended to this Context.

public void
addWrapperListener(String
Java class name of a ContainerListener class
listener
)

Implements org.apache.catalina.Context.addWrapperListener.

Add the classname of a ContainerListener to be added to each Wrapper appended to this Context.

protected String

Returns:

the URL pattern with a leading slash if needed
adjustURLPattern
(String
The URL pattern to be adjusted (if needed) and returned
urlPattern
)

Adjust the URL pattern to begin with a leading slash, if appropriate (i.e. we are running a servlet 2.2 application).

public synchronized void
backgroundProcess()

Overrides org.apache.catalina.core.ContainerBase.backgroundProcess.

Implements org.apache.catalina.Container.backgroundProcess.

Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container.

public ClassLoader
bind(boolean
Should a java.security.PrivilegedAction be used when obtaining the current thread context class loader and setting the new one?
usePrivilegedAction
,
ClassLoader
The current class loader if known to save this method having to look it up
originalClassLoader
)

Implements org.apache.tomcat.ContextBind.bind.

Change the current thread context class loader to the web application class loader.

protected ClassLoader

Returns:

the previous context class loader
bindThread
()

Bind current thread, both for CL purposes and for JNDI ENC support during : startup, shutdown and reloading of the context.

private Map<String, Map<String, String>>
private void
private void
checkUnusualURLPattern(String urlPattern)

Check for unusual but valid <url-pattern>s.

public InstanceManager
createInstanceManager()

Implements org.apache.catalina.Context.createInstanceManager.

Factory method to create and return a new InstanceManager instance.

public Wrapper
createWrapper()

Implements org.apache.catalina.Context.createWrapper.

Factory method to create and return a new Wrapper instance, of the Java implementation class appropriate for this Context implementation.

public void
protected void
destroyInternal()

Overrides org.apache.catalina.core.ContainerBase.destroyInternal.

Destroy needs to clean up the context completely.

public void
dynamicServletCreated(Servlet
the created Servlet
servlet
)

Hook to track which Servlets were created via ServletContext#createServlet(Class).

public boolean

Returns:

true if all filter initialization completed successfully, or false otherwise.
filterStart
()

Configure and initialize the set of filters for this Context.

public boolean

Returns:

true if all filter finalization completed successfully, or false otherwise.
filterStop
()

Finalize and release the set of filters for this Context.

public String[]
findApplicationListeners()

Implements org.apache.catalina.Context.findApplicationListeners.

Return the set of application listener class names configured for this application.

public ApplicationParameter[]
findApplicationParameters()

Implements org.apache.catalina.Context.findApplicationParameters.

Return the set of application parameters for this application.

public SecurityConstraint[]
findConstraints()

Implements org.apache.catalina.Context.findConstraints.

Return the security constraints for this web application.

public ErrorPage
findErrorPage(int
Error code to look up
errorCode
)

Implements org.apache.catalina.Context.findErrorPage.

Return the error page entry for the specified HTTP error code, if any; otherwise return null.

public ErrorPage
findErrorPage(Throwable
The exception type for which to find an ErrorPage
exceptionType
)

Implements org.apache.catalina.Context.findErrorPage.

Find and return the ErrorPage instance for the specified exception's class, or an ErrorPage instance for the closest superclass for which there is such a definition.

public ErrorPage[]
findErrorPages()

Implements org.apache.catalina.Context.findErrorPages.

Return the set of defined error pages for all specified error codes and exception types.

public FilterConfig

Returns:

the filter config object
findFilterConfig
(String
Name of the desired filter
name
)

Find and return the initialized FilterConfig for the specified filter name, if any; otherwise return null.

public FilterDef
findFilterDef(String
Filter name to look up
filterName
)

Implements org.apache.catalina.Context.findFilterDef.

Return the filter definition for the specified filter name, if any; otherwise return null.

public FilterDef[]

Returns:

the set of defined filters for this Context.
findFilterDefs
()

Implements org.apache.catalina.Context.findFilterDefs.

public FilterMap[]

Returns:

the set of filter mappings for this Context.
findFilterMaps
()

Implements org.apache.catalina.Context.findFilterMaps.

public MessageDestination

Returns:

the message destination with the specified name, if any; otherwise, return null.
findMessageDestination
(String
Name of the desired message destination
name
)

public MessageDestination[]

Returns:

the set of defined message destinations for this web application. If none have been defined, a zero-length array is returned.
findMessageDestinations
()

public String

Returns:

the MIME type to which the specified extension is mapped, if any; otherwise return null.
findMimeMapping
(String
Extension to map to a MIME type
extension
)

Implements org.apache.catalina.Context.findMimeMapping.

public String[]

Returns:

the extensions for which MIME mappings are defined. If there are none, a zero-length array is returned.
findMimeMappings
()

Implements org.apache.catalina.Context.findMimeMappings.

public String

Returns:

the value for the specified context initialization parameter name, if any; otherwise return null.
findParameter
(String
Name of the parameter to return
name
)

Implements org.apache.catalina.Context.findParameter.

public String[]

Returns:

the names of all defined context initialization parameters for this Context. If no parameters are defined, a zero-length array is returned.
findParameters
()

Implements org.apache.catalina.Context.findParameters.

public String
findPostConstructMethod(String
Fully qualified class name
clazz
)

Implements org.apache.catalina.Context.findPostConstructMethod.

Returns the method name that is specified as post construct method for the given class, if it exists; otherwise NULL will be returned.

public Map<String, String>
findPostConstructMethods()

Implements org.apache.catalina.Context.findPostConstructMethods.

Returns a map with keys - fully qualified class names of the classes that have post construct methods and the values are the corresponding method names.

public String
findPreDestroyMethod(String
Fully qualified class name
clazz
)

Implements org.apache.catalina.Context.findPreDestroyMethod.

Returns the method name that is specified as pre destroy method for the given class, if it exists; otherwise NULL will be returned.

public Map<String, String>
findPreDestroyMethods()

Implements org.apache.catalina.Context.findPreDestroyMethods.

Returns a map with keys - fully qualified class names of the classes that have pre destroy methods and the values are the corresponding method names.

public String

Returns:

the role name
findRoleMapping
(String
Security role to map
role
)

Implements org.apache.catalina.Context.findRoleMapping.

For the given security role (as used by an application), return the corresponding role name (as defined by the underlying Realm) if there is one.

public boolean

Returns:

true if the specified security role is defined for this application; otherwise return false.
findSecurityRole
(String
Security role to verify
role
)

Implements org.apache.catalina.Context.findSecurityRole.

public String[]

Returns:

the security roles defined for this application. If none have been defined, a zero-length array is returned.
findSecurityRoles
()

Implements org.apache.catalina.Context.findSecurityRoles.

public String

Returns:

the servlet name mapped by the specified pattern (if any); otherwise return null.
findServletMapping
(String
Pattern for which a mapping is requested
pattern
)

Implements org.apache.catalina.Context.findServletMapping.

public String[]

Returns:

the patterns of all defined servlet mappings for this Context. If no mappings are defined, a zero-length array is returned.
findServletMappings
()

Implements org.apache.catalina.Context.findServletMappings.

public String[]

Returns:

the set of watched resources for this Context. If none are defined, a zero length array will be returned.
findWatchedResources
()

Implements org.apache.catalina.Context.findWatchedResources.

public boolean

Returns:

true if the specified welcome file is defined for this Context; otherwise return false.
findWelcomeFile
(String
Welcome file to verify
name
)

Implements org.apache.catalina.Context.findWelcomeFile.

public String[]

Returns:

the set of welcome files defined for this Context. If none are defined, a zero-length array is returned.
findWelcomeFiles
()

Implements org.apache.catalina.Context.findWelcomeFiles.

public String[]

Returns:

the set of LifecycleListener classes that will be added to newly created Wrappers automatically.
findWrapperLifecycles
()

Implements org.apache.catalina.Context.findWrapperLifecycles.

public String[]

Returns:

the set of ContainerListener classes that will be added to newly created Wrappers automatically.
findWrapperListeners
()

Implements org.apache.catalina.Context.findWrapperListeners.

public boolean
fireRequestDestroyEvent(ServletRequest
The request object that will be passed to the listener
request
)

Implements org.apache.catalina.Context.fireRequestDestroyEvent.

Notify all jakarta.servlet.ServletRequestListeners that a request has ended.

public boolean
fireRequestInitEvent(ServletRequest
The request object that will be passed to the listener
request
)

Implements org.apache.catalina.Context.fireRequestInitEvent.

Notify all jakarta.servlet.ServletRequestListeners that a request has started.

public boolean
public boolean

Returns:

true if requests mapped to servlets without "multipart config" to parse multipart/form-data requests, false otherwise.
getAllowCasualMultipartParsing
()

Implements org.apache.catalina.Context.getAllowCasualMultipartParsing.

Returns true if requests mapped to servlets without "multipart config" to parse multipart/form-data requests anyway.

public boolean
public String

Returns:

the alternate Deployment Descriptor name.
getAltDDName
()

Implements org.apache.catalina.Context.getAltDDName.

Return the alternate Deployment Descriptor name.

public boolean
getAlwaysAccessSession()

Implements org.apache.catalina.Context.getAlwaysAccessSession.

If this is true, every request that is associated with a session will cause the session's last accessed time to be updated regardless of whether or not the request explicitly accesses the session.

public boolean

Returns:

the antiResourceLocking flag for this Context.
getAntiResourceLocking
()

public Object[]
getApplicationEventListeners()

Implements org.apache.catalina.Context.getApplicationEventListeners.

Obtain the registered application event listeners.

public Object[]
getApplicationLifecycleListeners()

Implements org.apache.catalina.Context.getApplicationLifecycleListeners.

Obtain the registered application lifecycle listeners.

public Authenticator
public String
public String
getCharset(Locale
The locale for which the mapped character set should be returned
locale
)

Implements org.apache.catalina.Context.getCharset.

Obtain the character set name to use with the given Locale.

public CharsetMapper

Returns:

the Locale to character set mapper for this Context.
getCharsetMapper
()

public String

Returns:

the Locale to character set mapper class for this Context.
getCharsetMapperClass
()

public boolean

Returns:

the clearReferencesHttpClientKeepAliveThread flag for this Context.
getClearReferencesHttpClientKeepAliveThread
()

public boolean
public boolean
public boolean

Returns:

the clearReferencesStopThreads flag for this Context.
getClearReferencesStopThreads
()

public boolean

Returns:

the clearReferencesStopTimerThreads flag for this Context.
getClearReferencesStopTimerThreads
()

public boolean
protected boolean
public URL
getConfigFile()

Implements org.apache.catalina.Context.getConfigFile.

Return the URL of the XML descriptor for this context.

public boolean
getConfigured()

Implements org.apache.catalina.Context.getConfigured.

Return the "correctly configured" flag for this Context.

public String
getContainerSciFilter()

Implements org.apache.catalina.Context.getContainerSciFilter.

Obtains the regular expression that specifies which container provided SCIs should be filtered out and not used for this context.

public boolean
getContextGetResourceRequiresSlash()

Implements org.apache.catalina.Context.getContextGetResourceRequiresSlash.

If this is true then the path passed to ServletContext.getResource() or ServletContext.getResourceAsStream() must start with "/".

public CookieProcessor
public boolean
getCookies()

Implements org.apache.catalina.Context.getCookies.

Return the "use cookies for session ids" flag.

public boolean

Returns:

true if the META-INF/context.xml file included in a WAR will be copied to the host configuration base folder on deployment
getCopyXML
()

Flag which indicates if bundled context.xml files should be copied to the config folder.

public boolean
getCreateUploadTargets()

Implements org.apache.catalina.Context.getCreateUploadTargets.

Will Tomcat attempt to create an upload target used by this web application if it does not exist when the web application attempts to use it?

public boolean
getCrossContext()

Implements org.apache.catalina.Context.getCrossContext.

Return the "allow crossing servlet contexts" flag.

public String
public String
public boolean

Returns:

true if classloading delegates to the parent classloader first
getDelegate
()

Return the "follow standard delegation model" flag used to configure our ClassLoader.

public boolean
getDenyUncoveredHttpMethods()

Implements org.apache.catalina.Context.getDenyUncoveredHttpMethods.

Return the deny-uncovered-http-methods flag for this web application.

public boolean
getDispatchersUseEncodedPaths()

Implements org.apache.catalina.Context.getDispatchersUseEncodedPaths.

Are paths used in calls to obtain a request dispatcher expected to be encoded?

public boolean
getDispatcherWrapsSameObject()

Implements org.apache.catalina.Context.getDispatcherWrapsSameObject.

If this is true then any wrapped request or response object passed to an application dispatcher will be checked to ensure that it has wrapped the original request or response.

public String

Returns:

the display name of this web application.
getDisplayName
()

Implements org.apache.catalina.Context.getDisplayName.

Return the display name of this web application.

public boolean

Returns:

the distributable flag for this web application.
getDistributable
()

Implements org.apache.catalina.Context.getDistributable.

Get the distributable flag for this web application.

public String
getDocBase()

Implements org.apache.catalina.Context.getDocBase.

Obtain the document root for this Context.

public int
public int
public String
getEncodedPath()

Implements org.apache.catalina.Context.getEncodedPath.

Return the URL encoded context path

public int

Returns:

Cumulative error count of all servlets in this StandardContext
getErrorCount
()
Deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to storing the result of calls to this method in a long value rather than an int.

Gets the cumulative error count of all servlets in this StandardContext.

public Boolean
public boolean
public boolean

Returns:

the boolean on the annotations parsing.
getIgnoreAnnotations
()

Implements org.apache.catalina.Context.getIgnoreAnnotations.

Determine if annotations parsing is currently disabled

public long
public InstanceManager
public String
public String
public JarScanner
getJarScanner()

Implements org.apache.catalina.Context.getJarScanner.

Get the Jar Scanner to be used to scan for JAR resources for this context.

public boolean

Returns:

whether or not an attempt to modify the JNDI context will trigger an exception or if the request will be ignored.
getJndiExceptionOnFailedWrite
()

public JspConfigDescriptor
public Loader
public boolean
getLogEffectiveWebXml()

Implements org.apache.catalina.Context.getLogEffectiveWebXml.

Should the effective web.xml for this context be logged on context start?

public LoginConfig

Returns:

the login configuration descriptor for this web application.
getLoginConfig
()

Implements org.apache.catalina.Context.getLoginConfig.

public Manager
public boolean
getMapperContextRootRedirectEnabled()

Implements org.apache.catalina.Context.getMapperContextRootRedirectEnabled.

Determines if requests for a web application context root will be redirected (adding a trailing slash) by the Mapper.

public boolean
getMapperDirectoryRedirectEnabled()

Implements org.apache.catalina.Context.getMapperDirectoryRedirectEnabled.

Determines if requests for a directory will be redirected (adding a trailing slash) by the Mapper.

public long

Returns:

Maximum processing time of all servlets in this StandardContext
getMaxTime
()

Gets the maximum processing time of all servlets in this StandardContext.

public long

Returns:

Minimum processing time of all servlets in this StandardContext
getMinTime
()

Gets the minimum processing time of all servlets in this StandardContext.

public NamingContextListener

Returns:

the naming context listener associated with the webapp
getNamingContextListener
()

Naming context listener accessor.

private String

Returns:

the context name
getNamingContextName
()

Get naming context full name.

public NamingResourcesImpl

Returns:

the naming resources associated with this web application.
getNamingResources
()

Implements org.apache.catalina.Context.getNamingResources.

public Object
public MBeanNotificationInfo[]
private String
protected String
getObjectNameKeyProperties()

Implements abstract org.apache.catalina.util.LifecycleMBeanBase.getObjectNameKeyProperties.

Allow sub-classes to specify the key properties component of the ObjectName that will be used to register this component.

public String

Returns:

the original document root for this Context. This can be an absolute pathname, a relative pathname, or a URL. Is only set as deployment has change docRoot!
getOriginalDocBase
()

public boolean

Returns:

the default context override flag for this web application.
getOverride
()

Implements org.apache.catalina.Context.getOverride.

public boolean
public ClassLoader

Returns:

the parent class loader (if any) for this web application. This call is meaningful only after a Loader has been configured.
getParentClassLoader
()

Overrides org.apache.catalina.core.ContainerBase.getParentClassLoader.

Implements org.apache.catalina.Container.getParentClassLoader.

Get the parent class loader.

public String

Returns:

the context path for this Context.
getPath
()

Implements org.apache.catalina.Context.getPath.

public boolean

Returns:

the request processing paused flag for this Context.
getPaused
()

Implements org.apache.catalina.Context.getPaused.

Is this Context paused whilst it is reloaded?

public boolean
public boolean

Returns:

the privileged flag for this web application.
getPrivileged
()

Implements org.apache.catalina.Context.getPrivileged.

public long

Returns:

Cumulative processing times of all servlets in this StandardContext
getProcessingTime
()

Gets the cumulative processing times of all servlets in this StandardContext.

public String

Returns:

the public identifier of the deployment descriptor DTD that is currently being parsed.
getPublicId
()

Implements org.apache.catalina.Context.getPublicId.

public String
getRealPath(String
The path to the desired resource
path
)

Implements org.apache.catalina.Context.getRealPath.

Return the real path for a given virtual path, if possible; otherwise return null.

public boolean

Returns:

the reloadable flag for this web application.
getReloadable
()

Implements org.apache.catalina.Context.getReloadable.

public boolean
public String
getRequestCharacterEncoding()

Implements org.apache.catalina.Context.getRequestCharacterEncoding.

Get the default request body encoding for this web application.

public int

Returns:

Cumulative request count of all servlets in this StandardContext
getRequestCount
()
Deprecated The return type will change to long in Tomcat 11 onwards. Callers of this method should switch to storing the result of calls to this method in a long value rather than an int.

Gets the cumulative request count of all servlets in this StandardContext.

public String
getResourceOnlyServlets()

Implements org.apache.catalina.Context.getResourceOnlyServlets.

Obtains the list of Servlets that expect a resource to be present.

public WebResourceRoot
public String
getResponseCharacterEncoding()

Implements org.apache.catalina.Context.getResponseCharacterEncoding.

Get the default response body encoding for this web application.

public boolean
public String
public ServletContext

Returns:

the servlet context for which this Context is a facade.
getServletContext
()

Implements org.apache.catalina.Context.getServletContext.

public String

Returns:

The value of the default session cookie domain or null if not specified
getSessionCookieDomain
()

Implements org.apache.catalina.Context.getSessionCookieDomain.

Gets the domain to use for session cookies.

public String

Returns:

The value of the default session cookie name or null if not specified
getSessionCookieName
()

Implements org.apache.catalina.Context.getSessionCookieName.

Gets the name to use for session cookies.

public String

Returns:

The value of the default session cookie path or null if not specified
getSessionCookiePath
()

Implements org.apache.catalina.Context.getSessionCookiePath.

Gets the path to use for session cookies.

public boolean
getSessionCookiePathUsesTrailingSlash()

Implements org.apache.catalina.Context.getSessionCookiePathUsesTrailingSlash.

Is a / added to the end of the session cookie path to ensure browsers, particularly IE, don't send a session cookie for context /foo with requests intended for context /foobar.

public int

Returns:

the default session timeout (in minutes) for this web application.
getSessionTimeout
()

Implements org.apache.catalina.Context.getSessionTimeout.

public boolean
public long

Returns:

Time (in milliseconds since January 1, 1970, 00:00:00) when this context was started
getStartTime
()

Gets the time this context was started.

public long

Returns:

Time (in milliseconds) it took to start this context.
getStartupTime
()

Gets the time (in milliseconds) it took to start this context.

public boolean

Returns:

true if data will be swallowed (default), false otherwise.
getSwallowAbortedUploads
()

Implements org.apache.catalina.Context.getSwallowAbortedUploads.

Returns true if remaining request data will be read (swallowed) even the request violates a data size constraint.

public boolean

Returns:

the value of the swallowOutput flag.
getSwallowOutput
()

Implements org.apache.catalina.Context.getSwallowOutput.

public ThreadBindingListener
public long
public boolean
getTldValidation()

Implements org.apache.catalina.Context.getTldValidation.

Will the parsing of *.tld files for this Context be performed by a validating parser?

public long

Returns:

the value of the unloadDelay flag.
getUnloadDelay
()

public boolean

Returns:

unpack WAR flag.
getUnpackWAR
()

public boolean
public boolean

Returns:

true if the HttpOnly flag should be set on session cookies
getUseHttpOnly
()

Implements org.apache.catalina.Context.getUseHttpOnly.

Gets the value of the use HttpOnly cookies for session cookies flag.

public boolean
getUsePartitioned()

Implements org.apache.catalina.Context.getUsePartitioned.

Should the Partitioned attribute be added to session cookies created for this web application.

public boolean
getUseRelativeRedirects()

Implements org.apache.catalina.Context.getUseRelativeRedirects.

Will HTTP 1.1 and later location headers generated by a call to jakarta.servlet.http.HttpServletResponse#sendRedirect(String) use relative or absolute redirects.

public boolean
public String
public String[]

Returns:

the naming resources associated with this web application.
getWelcomeFiles
()

public String

Returns:

the work directory for this Context.
getWorkDir
()

public String

Returns:

The work path
getWorkPath
()

Get the absolute path to the work dir.

public String

Returns:

the Java class name of the Wrapper implementation used for servlets registered in this Context.
getWrapperClass
()

Implements org.apache.catalina.Context.getWrapperClass.

public boolean
getXmlBlockExternal()

Implements org.apache.catalina.Context.getXmlBlockExternal.

Will the parsing of web.xml, web-fragment.xml, *.tld, *.jspx, *.tagx and tagplugin.xml files for this Context block the use of external entities?

public boolean
getXmlNamespaceAware()

Implements org.apache.catalina.Context.getXmlNamespaceAware.

Will the parsing of web.xml and web-fragment.xml files for this Context be performed by a namespace aware parser?

public boolean
getXmlValidation()

Implements org.apache.catalina.Context.getXmlValidation.

Will the parsing of web.xml and web-fragment.xml files for this Context be performed by a validating parser?

public void
protected void
initInternal()

Overrides org.apache.catalina.util.LifecycleMBeanBase.initInternal.

Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method.

public boolean
isResourceOnlyServlet(String
Name of the Servlet (as per web.xml) to check
servletName
)

Implements org.apache.catalina.Context.isResourceOnlyServlet.

Checks the named Servlet to see if it expects a resource to be present.

public boolean

Returns:

true if running a legacy Servlet 2.2 application
isServlet22
()

Implements org.apache.catalina.Context.isServlet22.

Are we processing a version 2.2 deployment descriptor?

public boolean

Returns:

true if the internal naming support is used.
isUseNaming
()

public boolean

Returns:

true if all listeners wre initialized successfully, or false otherwise.
listenerStart
()

Configure the set of instantiated application event listeners for this Context.

public boolean

Returns:

true if all events were sent successfully, or false otherwise.
listenerStop
()

Send an application stop event to all interested listeners.

public boolean

Returns:

true if load on startup was considered successful
loadOnStartup
(Container[]
Array of wrappers for all currently defined servlets (including those not declared load on startup)
children
)

Load and initialize all servlets marked "load on startup" in the web application deployment descriptor.

private void
mergeParameters()

Merge the context initialization parameters specified in the application deployment descriptor with the application parameters described in the server configuration, respecting the override property of the application parameters appropriately.

protected void
postWorkDirectory()

Set the appropriate context attribute for our work directory.

public synchronized void
reload()

Implements org.apache.catalina.Context.reload.

Reload this web application, if reloading is supported.

public void
removeApplicationListener(String
Java class name of the listener to be removed
listener
)

Implements org.apache.catalina.Context.removeApplicationListener.

Remove the specified application listener class from the set of listeners for this application.

public void
removeApplicationParameter(String
Name of the application parameter to remove
name
)

Implements org.apache.catalina.Context.removeApplicationParameter.

Remove the application parameter with the specified name from the set for this application.

public void
removeChild(Container
Child container to be added
child
)

Overrides org.apache.catalina.core.ContainerBase.removeChild.

Implements org.apache.catalina.Container.removeChild.

Add a child Container, only if the proposed child is an implementation of Wrapper.

public void
removeConstraint(SecurityConstraint
Constraint to be removed
constraint
)

Implements org.apache.catalina.Context.removeConstraint.

Remove the specified security constraint from this web application.

public void
removeErrorPage(ErrorPage
The error page definition to be removed
errorPage
)

Implements org.apache.catalina.Context.removeErrorPage.

Remove the error page for the specified error code or Java language exception, if it exists; otherwise, no action is taken.

public void
removeFilterDef(FilterDef
Filter definition to be removed
filterDef
)

Implements org.apache.catalina.Context.removeFilterDef.

Remove the specified filter definition from this Context, if it exists; otherwise, no action is taken.

public void
removeFilterMap(FilterMap
The filter mapping to be removed
filterMap
)

Implements org.apache.catalina.Context.removeFilterMap.

Remove a filter mapping from this Context.

public void
removeMessageDestination(String
Name of the message destination to remove
name
)

Remove any message destination with the specified name.

public void
removeMimeMapping(String
Extension to remove the mapping for
extension
)

Implements org.apache.catalina.Context.removeMimeMapping.

Remove the MIME mapping for the specified extension, if it exists; otherwise, no action is taken.

public void
removeNotificationListener(NotificationListener
A listener that was previously added to this MBean.
listener
,
NotificationFilter
The filter that was specified when the listener was added.
filter
,
Object
The handback that was specified when the listener was added.
object
)

Implements javax.management.NotificationEmitter.removeNotificationListener.

Remove a JMX notificationListener

public void
removeNotificationListener(NotificationListener
A listener that was previously added to this MBean.
listener
)

Implements javax.management.NotificationBroadcaster.removeNotificationListener.

Remove a JMX-NotificationListener

public void
removeParameter(String
Name of the parameter to remove
name
)

Implements org.apache.catalina.Context.removeParameter.

Remove the context initialization parameter with the specified name, if it exists; otherwise, no action is taken.

public void
removePostConstructMethod(String
Fully qualified class name
clazz
)

Implements org.apache.catalina.Context.removePostConstructMethod.

Removes the post construct method definition for the given class, if it exists; otherwise, no action is taken.

public void
removePreDestroyMethod(String
Fully qualified class name
clazz
)

Implements org.apache.catalina.Context.removePreDestroyMethod.

Removes the pre destroy method definition for the given class, if it exists; otherwise, no action is taken.

public void
removeRoleMapping(String
Security role (as used in the application) to remove
role
)

Implements org.apache.catalina.Context.removeRoleMapping.

Remove any security role reference for the specified name

public void
removeSecurityRole(String
Security role to remove
role
)

Implements org.apache.catalina.Context.removeSecurityRole.

Remove any security role with the specified name.

public void
removeServletMapping(String
URL pattern of the mapping to remove
pattern
)

Implements org.apache.catalina.Context.removeServletMapping.

Remove any servlet mapping for the specified pattern, if it exists; otherwise, no action is taken.

public void
removeWatchedResource(String
Name of the watched resource to be removed
name
)

Implements org.apache.catalina.Context.removeWatchedResource.

Remove the specified watched resource name from the list associated with this Context.

public void
removeWelcomeFile(String
Name of the welcome file to be removed
name
)

Implements org.apache.catalina.Context.removeWelcomeFile.

Remove the specified welcome file name from the list recognized by this Context.

public void
removeWrapperLifecycle(String
Class name of a LifecycleListener class to be removed
listener
)

Implements org.apache.catalina.Context.removeWrapperLifecycle.

Remove a class name from the set of LifecycleListener classes that will be added to newly created Wrappers.

public void
removeWrapperListener(String
Class name of a ContainerListener class to be removed
listener
)

Implements org.apache.catalina.Context.removeWrapperListener.

Remove a class name from the set of ContainerListener classes that will be added to newly created Wrappers.

private void
public void
resourcesStart()

Allocate resources, including proxy.

public boolean

Returns:

true if no error occurred
resourcesStop
()

Deallocate resources and destroy proxy.

public void
setAddWebinfClassesResources(boolean
The new value for the flag
addWebinfClassesResources
)

Implements org.apache.catalina.Context.setAddWebinfClassesResources.

Sets the flag that indicates if /WEB-INF/classes should be treated like an exploded JAR and JAR resources made available as if they were in a JAR.

public void
setAllowCasualMultipartParsing(boolean
true to allow such casual parsing, false otherwise.
allowCasualMultipartParsing
)

Implements org.apache.catalina.Context.setAllowCasualMultipartParsing.

Set to true to allow requests mapped to servlets that do not explicitly declare @MultipartConfig or have <multipart-config> specified in web.xml to parse multipart/form-data requests.

public void
setAllowMultipleLeadingForwardSlashInPath(boolean
The new value for the flag
allowMultipleLeadingForwardSlashInPath
)

Implements org.apache.catalina.Context.setAllowMultipleLeadingForwardSlashInPath.

Configure if, when returning a context path from jakarta.servlet.http.HttpServletRequest#getContextPath(), the return value is allowed to contain multiple leading '/' characters.

public void
setAltDDName(String
The new name
altDDName
)

Implements org.apache.catalina.Context.setAltDDName.

Set an alternate Deployment Descriptor name.

public void
setAlwaysAccessSession(boolean
the new flag value
alwaysAccessSession
)

Implements org.apache.catalina.Context.setAlwaysAccessSession.

Set the session access behavior.

public void
setAntiResourceLocking(boolean
The new flag value
antiResourceLocking
)

Set the antiResourceLocking feature for this Context.

public void
setApplicationEventListeners(Object[]
The set of instantiated listener objects.
listeners
)

Implements org.apache.catalina.Context.setApplicationEventListeners.

Store the set of initialized application event listener objects, in the order they were specified in the web application deployment descriptor, for this application.

public void
setApplicationLifecycleListeners(Object[]
The set of instantiated listener objects.
listeners
)

Implements org.apache.catalina.Context.setApplicationLifecycleListeners.

Store the set of initialized application lifecycle listener objects, in the order they were specified in the web application deployment descriptor, for this application.

public void
setCharsetMapper(CharsetMapper
The new mapper
mapper
)

Set the Locale to character set mapper for this Context.

public void
setCharsetMapperClass(String
The new mapper class
mapper
)

Set the Locale to character set mapper class for this Context.

public void
setClearReferencesHttpClientKeepAliveThread(boolean
The new flag value
clearReferencesHttpClientKeepAliveThread
)

Set the clearReferencesHttpClientKeepAliveThread feature for this Context.

public void
setClearReferencesObjectStreamClassCaches(boolean clearReferencesObjectStreamClassCaches)

public void
setClearReferencesRmiTargets(boolean clearReferencesRmiTargets)

public void
setClearReferencesStopThreads(boolean
The new flag value
clearReferencesStopThreads
)

Set the clearReferencesStopThreads feature for this Context.

public void
setClearReferencesStopTimerThreads(boolean
The new flag value
clearReferencesStopTimerThreads
)

Set the clearReferencesStopTimerThreads feature for this Context.

public void
setClearReferencesThreadLocals(boolean clearReferencesThreadLocals)

public void
setConfigFile(URL
The URL of the XML descriptor for this context.
configFile
)

Implements org.apache.catalina.Context.setConfigFile.

Set the URL of the XML descriptor for this context.

public void
setConfigured(boolean
The new correctly configured flag
configured
)

Implements org.apache.catalina.Context.setConfigured.

Set the "correctly configured" flag for this Context.

public void
setContainerSciFilter(String
The regular expression against which the fully qualified class name of each container provided SCI should be checked
containerSciFilter
)

Implements org.apache.catalina.Context.setContainerSciFilter.

Sets the regular expression that specifies which container provided SCIs should be filtered out and not used for this context.

public void
setContextGetResourceRequiresSlash(boolean
the new flag value
contextGetResourceRequiresSlash
)

Implements org.apache.catalina.Context.setContextGetResourceRequiresSlash.

Allow using ServletContext.getResource() or ServletContext.getResourceAsStream() without a leading "/".

public void
setCookieProcessor(CookieProcessor
The new cookie processor
cookieProcessor
)

Implements org.apache.catalina.Context.setCookieProcessor.

Sets the CookieProcessor that will be used to process cookies for this Context.

public void
setCookies(boolean
The new flag
cookies
)

Implements org.apache.catalina.Context.setCookies.

Set the "use cookies for session ids" flag.

public void
setCopyXML(boolean
the new flag value
copyXML
)

Allows copying a bundled context.xml file to the host configuration base folder on deployment.

public void
setCreateUploadTargets(boolean
true if Tomcat should attempt to create the upload target, otherwise false
createUploadTargets
)

Implements org.apache.catalina.Context.setCreateUploadTargets.

Configure whether Tomcat will attempt to create an upload target used by this web application if it does not exist when the web application attempts to use it.

public void
setCrossContext(boolean
The new cross contexts flag
crossContext
)

Implements org.apache.catalina.Context.setCrossContext.

Set the "allow crossing servlet contexts" flag.

public void
setDefaultContextXml(String
The default web xml
defaultContextXml
)

Set the location of the default context xml that will be used.

public void
setDefaultWebXml(String
The default web xml
defaultWebXml
)

Set the location of the default web xml that will be used.

public void
setDelegate(boolean
The new flag
delegate
)

Set the "follow standard delegation model" flag used to configure our ClassLoader.

public void
setDenyUncoveredHttpMethods(boolean
The new deny-uncovered-http-methods flag
denyUncoveredHttpMethods
)

Implements org.apache.catalina.Context.setDenyUncoveredHttpMethods.

Set the deny-uncovered-http-methods flag for this web application.

public void
setDispatchersUseEncodedPaths(boolean
true to use encoded paths, otherwise false
dispatchersUseEncodedPaths
)

Implements org.apache.catalina.Context.setDispatchersUseEncodedPaths.

Are paths used in calls to obtain a request dispatcher expected to be encoded?

public void
setDispatcherWrapsSameObject(boolean
the new flag value
dispatcherWrapsSameObject
)

Implements org.apache.catalina.Context.setDispatcherWrapsSameObject.

Allow disabling the object wrap check in the request dispatcher.

public void
setDisplayName(String
The new display name
displayName
)

Implements org.apache.catalina.Context.setDisplayName.

Set the display name of this web application.

public void
setDistributable(boolean
The new distributable flag
distributable
)

Implements org.apache.catalina.Context.setDistributable.

Set the distributable flag for this web application.

public void
setDocBase(String
The new document root
docBase
)

Implements org.apache.catalina.Context.setDocBase.

Set the document root for this Context.

public void
setEffectiveMajorVersion(int
Set the version number
effectiveMajorVersion
)

Implements org.apache.catalina.Context.setEffectiveMajorVersion.

Set the effective major version of the Servlet spec used by this context.

public void
setEffectiveMinorVersion(int
Set the version number
effectiveMinorVersion
)

Implements org.apache.catalina.Context.setEffectiveMinorVersion.

Set the effective minor version of the Servlet spec used by this context.

public void
setFailCtxIfServletStartFails(Boolean failCtxIfServletStartFails)

public void
setFireRequestListenersOnForwards(boolean
true to fire request listeners when forwarding
enable
)

Implements org.apache.catalina.Context.setFireRequestListenersOnForwards.

Configure whether or not requests listeners will be fired on forwards for this Context.

public void
setIgnoreAnnotations(boolean
The boolean on the annotations parsing
ignoreAnnotations
)

Implements org.apache.catalina.Context.setIgnoreAnnotations.

Set the boolean on the annotations parsing for this web application.

public void
setInstanceManager(InstanceManager
the new instance manager instance
instanceManager
)

Implements org.apache.catalina.Context.setInstanceManager.

Set the instance manager associated with this context.

public void
setJ2EEApplication(String j2EEApplication)

public void
setJ2EEServer(String j2EEServer)

public void
setJarScanner(JarScanner
The Jar Scanner to be used for this context.
jarScanner
)

Implements org.apache.catalina.Context.setJarScanner.

Set the Jar Scanner to be used to scan for JAR resources for this context.

public void
setJndiExceptionOnFailedWrite(boolean
false to avoid an exception
jndiExceptionOnFailedWrite
)

Controls whether or not an attempt to modify the JNDI context will trigger an exception or if the request will be ignored.

public void
setJspConfigDescriptor(JspConfigDescriptor
the new JSP configuration
descriptor
)

Implements org.apache.catalina.Context.setJspConfigDescriptor.

Set the JspConfigDescriptor for this context.

public void
setLoader(Loader
The newly associated loader
loader
)

Implements org.apache.catalina.Context.setLoader.

Set the Loader with which this Context is associated.

public void
setLogEffectiveWebXml(boolean
set to true to log the complete web.xml that will be used for the webapp
logEffectiveWebXml
)

Implements org.apache.catalina.Context.setLogEffectiveWebXml.

Set whether or not the effective web.xml for this context should be logged on context start.

public void
setLoginConfig(LoginConfig
The new login configuration
config
)

Implements org.apache.catalina.Context.setLoginConfig.

Set the login configuration descriptor for this web application.

public void
setManager(Manager
The newly associated Manager
manager
)

Implements org.apache.catalina.Context.setManager.

Set the Manager with which this Context is associated.

public void
setMapperContextRootRedirectEnabled(boolean
Should the redirects be enabled?
mapperContextRootRedirectEnabled
)

Implements org.apache.catalina.Context.setMapperContextRootRedirectEnabled.

If enabled, requests for a web application context root will be redirected (adding a trailing slash) by the Mapper.

public void
setMapperDirectoryRedirectEnabled(boolean
Should the redirects be enabled?
mapperDirectoryRedirectEnabled
)

Implements org.apache.catalina.Context.setMapperDirectoryRedirectEnabled.

If enabled, requests for a directory will be redirected (adding a trailing slash) by the Mapper.

public void
setNamingContextListener(NamingContextListener
the new naming context listener
namingContextListener
)

Naming context listener setter.

public void
setNamingResources(NamingResourcesImpl
The new naming resources
namingResources
)

Implements org.apache.catalina.Context.setNamingResources.

Set the naming resources for this web application.

public void
setOriginalDocBase(String
The original document root
docBase
)

Set the original document root for this Context.

public void
setOverride(boolean
The new override flag
override
)

Implements org.apache.catalina.Context.setOverride.

Set the default context override flag for this web application.

public void
setParallelAnnotationScanning(boolean
new parallel annotation scanning flag
parallelAnnotationScanning
)

Implements org.apache.catalina.Context.setParallelAnnotationScanning.

Set the parallel annotation scanning value.

public void
setPath(String
The new context path
path
)

Implements org.apache.catalina.Context.setPath.

Set the context path for this Context.

private void
setPaused(boolean
The new request processing paused flag
paused
)

Set the request processing paused flag for this Context.

public void
setPreemptiveAuthentication(boolean
true to perform authentication even outside security constraints
preemptiveAuthentication
)

Implements org.apache.catalina.Context.setPreemptiveAuthentication.

Configures if a user presents authentication credentials, whether the context will process them when the request is for a non-protected resource.

public void
setPrivileged(boolean
The new privileged flag
privileged
)

Implements org.apache.catalina.Context.setPrivileged.

Set the privileged flag for this web application.

public void
setPublicId(String
The public identifier
publicId
)

Implements org.apache.catalina.Context.setPublicId.

Set the public identifier of the deployment descriptor DTD that is currently being parsed.

public void
setReloadable(boolean
The new reloadable flag
reloadable
)

Implements org.apache.catalina.Context.setReloadable.

Set the reloadable flag for this web application.

public void
setRenewThreadsWhenStoppingContext(boolean renewThreadsWhenStoppingContext)

public void
setReplaceWelcomeFiles(boolean
The new property value
replaceWelcomeFiles
)

Set the "replace welcome files" property.

public void
setRequestCharacterEncoding(String
The default encoding
requestEncoding
)

Implements org.apache.catalina.Context.setRequestCharacterEncoding.

Set the default request body encoding for this web application.

public void
setResourceOnlyServlets(String
The Servlet names comma separated list
resourceOnlyServlets
)

Implements org.apache.catalina.Context.setResourceOnlyServlets.

Sets the (comma separated) list of Servlets that expect a resource to be present.

public void
setResources(WebResourceRoot
The newly associated Resources
resources
)

Implements org.apache.catalina.Context.setResources.

Set the Resources object with which this Context is associated.

public void
setResponseCharacterEncoding(String
The default encoding
responseEncoding
)

Implements org.apache.catalina.Context.setResponseCharacterEncoding.

Set the default response body encoding for this web application.

public void
setSendRedirectBody(boolean
true to send a response body for redirects
sendRedirectBody
)

Implements org.apache.catalina.Context.setSendRedirectBody.

Configures if a response body is included when a redirect response is sent to the client.

public String
setServer(String server)

public void
setSessionCookieDomain(String
The domain to use
sessionCookieDomain
)

Implements org.apache.catalina.Context.setSessionCookieDomain.

Sets the domain to use for session cookies.

public void
setSessionCookieName(String
The name to use
sessionCookieName
)

Implements org.apache.catalina.Context.setSessionCookieName.

Sets the name to use for session cookies.

public void
setSessionCookiePath(String
The path to use
sessionCookiePath
)

Implements org.apache.catalina.Context.setSessionCookiePath.

Sets the path to use for session cookies.

public void
setSessionCookiePathUsesTrailingSlash(boolean
true if the slash is should be added, otherwise false
sessionCookiePathUsesTrailingSlash
)

Implements org.apache.catalina.Context.setSessionCookiePathUsesTrailingSlash.

Configures if a / is added to the end of the session cookie path to ensure browsers, particularly IE, don't send a session cookie for context /foo with requests intended for context /foobar.

public void
setSessionTimeout(int
The new default session timeout
timeout
)

Implements org.apache.catalina.Context.setSessionTimeout.

Set the default session timeout (in minutes) for this web application.

public void
setSkipMemoryLeakChecksOnJvmShutdown(boolean skipMemoryLeakChecksOnJvmShutdown)

public void
setStartupTime(long startupTime)

public void
setSwallowAbortedUploads(boolean
false to disable swallowing, true otherwise (default).
swallowAbortedUploads
)

Implements org.apache.catalina.Context.setSwallowAbortedUploads.

Set to false to disable request data swallowing after an upload was aborted due to size constraints.

public void
setSwallowOutput(boolean
The new value
swallowOutput
)

Implements org.apache.catalina.Context.setSwallowOutput.

Set the value of the swallowOutput flag.

public void
setThreadBindingListener(ThreadBindingListener
Set the listener that will receive notifications when entering and exiting the application scope
threadBindingListener
)

Implements org.apache.catalina.Context.setThreadBindingListener.

Get the associated ThreadBindingListener.

public void
setTldScanTime(long tldScanTime)

public void
setTldValidation(boolean
true to enable xml validation
tldValidation
)

Implements org.apache.catalina.Context.setTldValidation.

Controls whether the parsing of *.tld files for this Context will be performed by a validating parser.

public void
setUnloadDelay(long
The new value
unloadDelay
)

Set the value of the unloadDelay flag, which represents the amount of ms that the container will wait when unloading servlets.

public void
setUnpackWAR(boolean
true to unpack WARs on deployment
unpackWAR
)

Unpack WAR flag mutator.

public void
setUseBloomFilterForArchives(boolean
The new fast class path scan flag
useBloomFilterForArchives
)

Implements org.apache.catalina.Context.setUseBloomFilterForArchives.

Deprecated

Set bloom filter flag value.

public void
setUseHttpOnly(boolean
Set to true to use HttpOnly cookies for session cookies
useHttpOnly
)

Implements org.apache.catalina.Context.setUseHttpOnly.

Sets the use HttpOnly cookies for session cookies flag.

public void
setUseNaming(boolean
true to enable the naming environment
useNaming
)

Enables or disables naming.

public void
setUsePartitioned(boolean
true if the Partitioned attribute should be added to session cookies created for this web application, otherwise false
usePartitioned
)

Implements org.apache.catalina.Context.setUsePartitioned.

Configure whether the Partitioned attribute should be added to session cookies created for this web application.

public void
setUseRelativeRedirects(boolean
true to use relative redirects and false to use absolute redirects
useRelativeRedirects
)

Implements org.apache.catalina.Context.setUseRelativeRedirects.

Controls whether HTTP 1.1 and later location headers generated by a call to jakarta.servlet.http.HttpServletResponse#sendRedirect(String) will use relative or absolute redirects.

public void
setValidateClientProvidedNewSessionId(boolean
true if validation should be applied
validateClientProvidedNewSessionId
)

Implements org.apache.catalina.Context.setValidateClientProvidedNewSessionId.

When a client provides the ID for a new session, should that ID be validated?

public void
setWebappVersion(String
The webapp version associated with the context, which should be unique
webappVersion
)

Implements org.apache.catalina.Context.setWebappVersion.

Set the version of this web application - used to differentiate different versions of the same web application when using parallel deployment.

public void
setWorkDir(String
The new work directory
workDir
)

Set the work directory for this Context.

public void
setWrapperClass(String
The new wrapper class name
wrapperClassName
)

Implements org.apache.catalina.Context.setWrapperClass.

Set the Java class name of the Wrapper implementation used for servlets registered in this Context.

public void
setXmlBlockExternal(boolean
true to block external entities
xmlBlockExternal
)

Implements org.apache.catalina.Context.setXmlBlockExternal.

Controls whether the parsing of web.xml, web-fragment.xml, *.tld, *.jspx, *.tagx and tagplugin.xml files for this Context will block the use of external entities.

public void
setXmlNamespaceAware(boolean
true to enable namespace awareness
webXmlNamespaceAware
)

Implements org.apache.catalina.Context.setXmlNamespaceAware.

Controls whether the parsing of web.xml and web-fragment.xml files for this Context will be performed by a namespace aware parser.

public void
setXmlValidation(boolean
true to enable xml validation
webXmlValidation
)

Implements org.apache.catalina.Context.setXmlValidation.

Controls whether the parsing of web.xml and web-fragment.xml files for this Context will be performed by a validating parser.

protected void
protected void
public void
unbind(boolean
Should a java.security.PrivilegedAction be used when setting the current thread context class loader?
usePrivilegedAction
,
ClassLoader
The class loader to restore as the thread context class loader
originalClassLoader
)

Implements org.apache.tomcat.ContextBind.unbind.

Restore the current thread context class loader to the original class loader in used before bind(boolean, ClassLoader) was called.

protected void
unbindThread(ClassLoader
the previous classloader
oldContextClassLoader
)

Unbind thread and restore the specified context classloader.

private void
validateFilterMap(FilterMap
the filter mapping
filterMap
)

Validate the supplied FilterMap.

private boolean

Returns:

true if the URL pattern is conformant
validateURLPattern
(String
URL pattern to be validated
urlPattern
)

Validate the syntax of a proposed <url-pattern> for conformance with specification requirements.

public boolean
Inherited from org.apache.catalina.core.ContainerBase:
addContainerListeneraddPropertyChangeListeneraddValvefindChildfindChildrenfindContainerListenersfireContainerEventgetAccessLoggetBackgroundProcessorDelaygetCatalinaBasegetCatalinaHomegetChildrengetClustergetClusterInternalgetDomainInternalgetLoggergetLogNamegetMBeanKeyPropertiesgetNamegetParentgetPipelinegetRealmgetRealmInternalgetStartChildrengetStartStopThreadslogAccessremoveContainerListenerremovePropertyChangeListenersetBackgroundProcessorDelaysetClustersetNamesetParentsetParentClassLoadersetRealmsetStartChildrensetStartStopThreadsthreadStartthreadStoptoString