Package com.sun.enterprise.web
Class ContextFacade
- java.lang.Object
-
- org.apache.catalina.core.ContainerBase
-
- org.apache.catalina.core.StandardContext
-
- com.sun.enterprise.web.pwc.PwcWebModule
-
- com.sun.enterprise.web.WebModule
-
- com.sun.enterprise.web.ContextFacade
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.catalina.core.StandardContext
StandardContext.RestrictedServletContextListener
-
Nested classes/interfaces inherited from class org.apache.catalina.core.ContainerBase
ContainerBase.ContainerBackgroundProcessor, ContainerBase.PrivilegedAddChild
-
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<String>
listenerNames
-
Fields inherited from class com.sun.enterprise.web.WebModule
cachedFinds, rb
-
Fields inherited from class com.sun.enterprise.web.pwc.PwcWebModule
_id, defaultCharset, formHintField, webSessionCookieConfig
-
Fields inherited from class org.apache.catalina.core.StandardContext
allowLinking, cacheMaxSize, cacheTTL, caseSensitive, caseSensitiveMapping, contextListeners, directoryDeployed, directoryListing, filterRegisMap, isJsfApplication, servletRegisMap, servletReloadCheckSecs, showArchivedRealPathEnabled, urlEncoder
-
Fields inherited from class org.apache.catalina.core.ContainerBase
backgroundProcessorDelay, checkIfRequestIsSecure, children, controller, debug, domain, hasCustomPipeline, initialized, lifecycle, listeners, loader, log, manager, name, notifyContainerListeners, oname, parent, parentClassLoader, pipeline, readLock, realm, resources, started, support, writeLock
-
Fields inherited from interface org.apache.catalina.Container
ADD_CHILD_EVENT, ADD_MAPPER_EVENT, ADD_VALVE_EVENT, REMOVE_CHILD_EVENT, REMOVE_MAPPER_EVENT, REMOVE_VALVE_EVENT
-
Fields inherited from interface org.apache.catalina.Context
RELOAD_EVENT
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description ContextFacade(File docRoot, String contextRoot, ClassLoader classLoader)
Construct a new instance of this class, associated with the specified Context instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jakarta.servlet.FilterRegistration.Dynamic
addFilter(String filterName, jakarta.servlet.Filter filter)
jakarta.servlet.FilterRegistration.Dynamic
addFilter(String filterName, Class<? extends jakarta.servlet.Filter> filterClass)
Adds the filter with the given name and class type to this servlet context.jakarta.servlet.FilterRegistration.Dynamic
addFilter(String filterName, String className)
Adds the filter with the given name and class name to this servlet context.jakarta.servlet.FilterRegistration.Dynamic
addFilterFacade(String filterName, String className)
void
addFilterMap(FilterMap filterMap, boolean isMatchAfter)
Add a filter mapping to this Context.void
addListener(Class<? extends EventListener> listenerClass)
Adds a listener of the given class type to this ServletContext.void
addListener(String className)
Adds the listener with the given class name to this ServletContext.<T extends EventListener>
voidaddListener(T t)
Adds the given listener instance to this ServletContext.jakarta.servlet.ServletRegistration.Dynamic
addServlet(String servletName, jakarta.servlet.Servlet servlet)
jakarta.servlet.ServletRegistration.Dynamic
addServlet(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass)
jakarta.servlet.ServletRegistration.Dynamic
addServlet(String servletName, String className)
jakarta.servlet.ServletRegistration.Dynamic
addServletFacade(String servletName, String className)
Set<String>
addServletMapping(String name, String[] urlPatterns)
Adds the given servlet mappings to this Context.protected ServletRegistrationImpl
createDynamicServletRegistrationImpl(StandardWrapper wrapper)
<T extends jakarta.servlet.Filter>
TcreateFilter(Class<T> clazz)
Instantiates the given Filter class and performs any required resource injection into the new Filter instance before returning it.<T extends EventListener>
TcreateListener(Class<T> clazz)
Instantiates the given EventListener class and performs any required resource injection into the new EventListener instance before returning it.<T extends jakarta.servlet.Servlet>
TcreateServlet(Class<T> clazz)
Instantiates the given Servlet class and performs any required resource injection into the new Servlet instance before returning it.protected ServletRegistrationImpl
createServletRegistrationImpl(StandardWrapper wrapper)
void
declareRoles(String... roleNames)
Map<String,String>
getAddedFilters()
Map<String,String>
getAddedServlets()
Returns previously added servletsString
getAppName()
Object
getAttribute(String name)
Return the value of the specified context attribute, if any; otherwise returnnull
.Enumeration<String>
getAttributeNames()
Return an enumeration of the names of the context attributes associated with this context.ClassLoader
getClassLoader()
Gets the class loader of the web application represented by this ServletContext.jakarta.servlet.ServletContext
getContext(String uripath)
Return aServletContext
object that corresponds to a specified URI on the server.String
getContextPath()
Returns the context path of the web application.String
getContextRoot()
Gets this web module's context root.Set<jakarta.servlet.SessionTrackingMode>
getDefaultSessionTrackingModes()
Gets the session tracking modes that are supported by default for this ServletContext.String
getDefaultWebXml()
File
getDocRoot()
int
getEffectiveMajorVersion()
int
getEffectiveMinorVersion()
Set<jakarta.servlet.SessionTrackingMode>
getEffectiveSessionTrackingModes()
Gets the session tracking modes that are in effect for this ServletContext.jakarta.servlet.FilterRegistration
getFilterRegistration(String filterName)
Gets the FilterRegistration corresponding to the filter with the given filterName.Map<String,? extends jakarta.servlet.FilterRegistration>
getFilterRegistrations()
Gets a Map of the FilterRegistration objects corresponding to all currently registered filters.String
getInitParameter(String name)
Return the value of the specified initialization parameter, ornull
if this parameter does not exist.Enumeration<String>
getInitParameterNames()
Return the names of the context's initialization parameters, or an empty enumeration if the context has no initialization parameters.jakarta.servlet.descriptor.JspConfigDescriptor
getJspConfigDescriptor()
Gets the<jsp-config>
related configuration that was aggregated over theweb.xml
andweb-fragment.xml
resources of the web application represented by this ServletContext.List<String>
getListeners()
int
getMajorVersion()
Return the major version of the Java Servlet API that we implement.String
getMimeType(String file)
Return the MIME type of the specified file, ornull
if the MIME type cannot be determined.int
getMinorVersion()
Return the minor version of the Java Servlet API that we implement.jakarta.servlet.RequestDispatcher
getNamedDispatcher(String name)
Return aRequestDispatcher
object that acts as a wrapper for the named servlet.String
getPath()
Return the context path for this Context.String
getRealPath(String path)
Return the real path corresponding to the given virtual path, ornull
if the container was unable to perform the translationjakarta.servlet.RequestDispatcher
getRequestDispatcher(String path)
Return aRequestDispatcher
instance that acts as a wrapper for the resource at the given path.URL
getResource(String path)
Return the URL to the resource that is mapped to a specified path.InputStream
getResourceAsStream(String path)
Return the requested resource as anInputStream
.Set<String>
getResourcePaths(String path)
Return a Set containing the resource paths of resources member of the specified collection.SecurityConfig
getSecurityConfig()
Gets the security related configuration for this contextString
getServerInfo()
Return the name and version of the servlet container.String
getServletContextName()
Return the display name of this web application.Map<String,String[]>
getServletMappings()
Map<String,String>
getServletNameFilterMappings()
jakarta.servlet.ServletRegistration
getServletRegistration(String servletName)
Gets the ServletRegistration corresponding to the servlet with the given servletName.Map<String,? extends jakarta.servlet.ServletRegistration>
getServletRegistrations()
Gets a Map of the ServletRegistration objects corresponding to all currently registered servlets.jakarta.servlet.SessionCookieConfig
getSessionCookieConfig()
Gets the session tracking cookie configuration of this ServletContext.WebModule
getUnwrappedContext()
Gets the underlying StandardContext to which this ContextFacade is ultimately delegating.Map<String,String>
getUrlPatternFilterMappings()
String
getVirtualServerName()
boolean
isDirectoryListing()
Checks whether directory listings are enabled or disabled on this Context.void
log(String msg)
Writes the specified message to a servlet log file.void
log(String message, Throwable throwable)
Writes the specified message and exception to a servlet log file.void
removeAttribute(String name)
Remove the context attribute with the specified name, if any.void
setAppName(String name)
void
setAttribute(String name, Object object)
Bind the specified value with the specified context attribute name, replacing any existing value for that name.void
setDefaultWebXml(String defaultWebXml)
Set the location of the default web xml that will be used.void
setDirectoryListing(boolean directoryListing)
Enables or disables directory listings on this Context.boolean
setInitParameter(String name, String value)
void
setPath(String path)
Set the context path for this Context.void
setSecurityConfig(SecurityConfig config)
Set the security related configuration for this contextvoid
setSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes)
Sets the session tracking modes that are to become effective for this ServletContext.void
setUnwrappedContext(WebModule wm)
-
Methods inherited from class com.sun.enterprise.web.WebModule
addAdHocValve, addCatalinaListener, addValve, addValve, afterServiceEvent, beforeServiceEvent, callServletContainerInitializers, configureCatalinaProperties, configureCatalinaProperties, configureSessionSettings, configureValves, contextListenerStart, createFilterInstance, createHttpUpgradeHandlerInstance, createListenerInstance, createObjectInputStream, createObjectOutputStream, createServletInstance, getAdHocPipeline, getAdHocServletName, getBean, getCachedFindOperation, getComponentId, getFileEncoding, getIasWebAppConfigBean, getLocaleCharsetMap, getMonitoringNodeName, getServerContext, getTypes, getUniqueId, getWebBundleDescriptor, getWebContainer, getWebModuleConfig, hasAdHocPaths, hasAdHocSubtrees, hasBeenXmlConfigured, hasLocaleToCharsetMapping, isStandalone, loadListener, mapLocalesToCharset, removeAdHocValve, removePatternFromServlet, servletDestroyedEvent, servletInitializedEvent, sessionActivatedEndEvent, sessionActivatedStartEvent, sessionCreatedEvent, sessionDestroyedEvent, sessionExpiredEvent, sessionPassivatedEndEvent, sessionPassivatedStartEvent, sessionPersistedEndEvent, sessionPersistedStartEvent, sessionRejectedEvent, setBean, setCachedFindOperation, setFileEncoding, setI18nInfo, setIasWebAppConfigBean, setParent, setRealm, setWebContainer, setWebModuleConfig, setXmlConfigured, start, stop, webModuleStartedEvent, webModuleStoppedEvent
-
Methods inherited from class com.sun.enterprise.web.pwc.PwcWebModule
createWrapper, getCacheControls, getDefaultCharset, getEncodeCookies, getEndpointAddresses, getFormHintField, getHasWebServices, getID, getModuleName, getResponseCTForHeaders, getSessionCookieConfigFromSunWebXml, getSTMPoolSize, hasWebXml, setCacheControls, setContextRoot, setEncodeCookies, setEndpointAddresses, setHasWebServices, setHasWebXml, setID, setModuleName, setResponseCTForHeaders, setSessionCookieConfigFromSunWebXml, setSTMPoolSize
-
Methods inherited from class org.apache.catalina.core.StandardContext
addAlternateDocBase, addApplicationListener, addApplicationParameter, addChild, addChild, addConstraint, addEjb, addEnvironment, addEnvironment, addErrorPage, addFilterDef, addFilterDef, addFilterMap, addFilterMaps, addInstanceListener, addInstanceListener, addJspFile, addJspMapping, addLocaleEncodingMappingParameter, addLocalEjb, addMessageDestination, addMessageDestinationRef, addMimeMapping, addParameter, addResource, addResource, addResourceEnvRef, addResourceLink, addResourceLink, addResourceParams, addRoleMapping, addSecurityRole, addServlet, addServlet, addServletMapping, addServletMapping, addServletMapping, addWatchedResource, addWelcomeFile, addWrapperLifecycle, addWrapperListener, adjustURLPattern, alternateResourcesStart, alternateResourcesStop, backgroundProcess, create, createLoader, createObjectName, createObjectName, createObjectName, createObjectName, destroy, engineBase, filterStart, filterStop, findApplicationParameters, findEjb, findEjbs, findEnvironment, findEnvironments, findErrorPage, findErrorPage, findFilterConfig, findFilterDef, findFilterDefs, findFilterMaps, findInstanceListeners, findLocalEjb, findLocalEjbs, findMappingObject, findMessageDestination, findMessageDestinationRef, findMessageDestinationRefs, findMessageDestinations, findMimeMapping, findMimeMappings, findParameter, findParameters, findResource, findResourceEnvRef, findResourceEnvRefs, findResourceLink, findResourceLinks, findResources, findRoleMapping, findServletMapping, findServletMappings, findStaticResources, findStatusPage, findStatusPages, findWelcomeFile, findWelcomeFiles, findWrapperLifecycles, findWrapperListeners, fireRequestDestroyedEvent, fireRequestInitializedEvent, getAllowRelativeRedirect, getAltDDName, getAlternateDocBases, getAntiJARLocking, getApplicationEventListeners, getAuditors, getAuthenticator, getAvailable, getCacheMaxSize, getCacheTTL, getCharsetMapper, getCharsetMapperClass, getCompilerClasspath, getConfigFile, getConfigured, getConstraints, getCookies, getCrossContext, getDefaultConfigFile, getDefaultErrorPage, getDelegate, getDisplayName, getDistributable, getDocBase, getEncodedPath, getEngineName, getEnvironments, getHostname, getInfo, getJ2EEApplication, getJ2EEServer, getJvmRoute, getLoginConfig, getManagerChecksFrequency, getMapper, getNamingContextName, getNamingResources, getOriginalDocBase, getOverride, getParentName, getPaused, getPrivileged, getPublicId, getReloadable, getRequestCharacterEncoding, getResourceLinks, getResourceNames, getResponseCharacterEncoding, getReuseSessionID, getServletContext, getServletNameFilterMappings, getSessionCookieName, getSessionListeners, getSessionParameterName, getSessionTimeout, getStartTimeMillis, getStartupTime, getState, getStaticResources, getTldNamespaceAware, getTldScanTime, getTldValidation, getUnloadDelay, getUnpackWAR, getUrlPatternFilterMappings, getWatchedResources, getWelcomeFiles, getWorkDir, getWorkPath, getXmlNamespaceAware, getXmlValidation, hasConstraints, hasFilter, hasSecurityRole, hasServlet, hasWatchedResources, init, isAllowLinking, isCachingAllowed, isCaseSensitive, isCaseSensitiveMapping, isEmbedded, isEnableURLRewriting, isEventProvider, isFilesystemBased, isJsfApplication, isReload, isReplaceWelcomeFiles, isSecurePagesWithPragma, isServlet22, isSessionTimeoutOveridden, isStatisticsProvider, isUseMyFaces, isUseNaming, loadOnStartup, managerStart, managerStop, reload, removeApplicationParameter, removeChild, removeConstraints, removeEjb, removeEnvironment, removeErrorPages, removeFilterDef, removeFilterMaps, removeInstanceListener, removeLocalEjb, removeMessageDestination, removeMessageDestinationRef, removeMimeMapping, removeParameter, removeResource, removeResourceEnvRef, removeResourceLink, removeRoleMapping, removeSecurityRoles, removeServletMapping, removeWatchedResources, removeWelcomeFiles, removeWrapperLifecycles, removeWrapperListeners, resourcesStart, resourcesStop, restrictedSetPipeline, sendNotification, setAllowLinking, setAllowRelativeRedirect, setAltDDName, setAntiJARLocking, setAuditors, setAvailable, setCacheMaxSize, setCacheTTL, setCachingAllowed, setCaseSensitive, setCaseSensitiveMapping, setCharsetMapper, setCharsetMapperClass, setCompilerClasspath, setConfigFile, setConfigured, setCookies, setCrossContext, setDelegate, setDisplayName, setDistributable, setDocBase, setEffectiveMajorVersion, setEffectiveMinorVersion, setEmbedded, setEnableURLRewriting, setEngineName, setJ2EEApplication, setJ2EEServer, setJspConfigDescriptor, setJvmRoute, setLoginConfig, setManagerChecksFrequency, setName, setNamingResources, setOrderedLibs, setOriginalDocBase, setOverride, setPrivileged, setPublicId, setReload, setReloadable, setReplaceWelcomeFiles, setRequestCharacterEncoding, setResources, setResponseCharacterEncoding, setReuseSessionID, setSecurePagesWithPragma, setServletContainerInitializerInterestList, setSessionTimeout, setStartupTime, setTldNamespaceAware, setTldScanTime, setTldValidation, setUnloadDelay, setUnpackWAR, setUseMyFaces, setUseNaming, setWorkDir, setXmlNamespaceAware, setXmlValidation, startRecursive, stop, toString, validateURLPattern
-
Methods inherited from class org.apache.catalina.core.ContainerBase
addContainerListener, addLifecycleListener, addPropertyChangeListener, addValve, addValve, findChild, findChildren, findContainerListeners, findLifecycleListeners, fireContainerEvent, getBackgroundProcessorDelay, getBasic, getChildren, getContainerSuffix, getDebug, getDomain, getJmxName, getLoader, getLogger, getManager, getMappingObject, getName, getObjectName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, getValveObjectNames, getValves, hasCustomPipeline, hasNonBasicValves, invoke, isCheckIfRequestIsSecure, logName, removeContainerListener, removeLifecycleListener, removeLifecycleListeners, removePropertyChangeListener, removeValve, setBackgroundProcessorDelay, setBasic, setCheckIfRequestIsSecure, setDebug, setDomain, setLoader, setLogger, setManager, setParentClassLoader, startChildren, threadStart, threadStop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.catalina.Container
addContainerListener, addPropertyChangeListener, findChild, findChildren, findContainerListeners, fireContainerEvent, getBackgroundProcessorDelay, getLoader, getLogger, getManager, getMappingObject, getName, getParent, getParentClassLoader, getPipeline, getRealm, getResources, hasCustomPipeline, invoke, isCheckIfRequestIsSecure, removeContainerListener, removePropertyChangeListener, setBackgroundProcessorDelay, setCheckIfRequestIsSecure, setLoader, setLogger, setManager, setParentClassLoader
-
-
-
-
Constructor Detail
-
ContextFacade
public ContextFacade(File docRoot, String contextRoot, ClassLoader classLoader)
Construct a new instance of this class, associated with the specified Context instance.- Parameters:
docRoot
-contextRoot
-classLoader
-
-
-
Method Detail
-
getAppName
public String getAppName()
-
setAppName
public void setAppName(String name)
-
getContextRoot
public String getContextRoot()
Description copied from class:PwcWebModule
Gets this web module's context root.- Overrides:
getContextRoot
in classPwcWebModule
- Returns:
- Web module context root
-
getDocRoot
public File getDocRoot()
-
getContextPath
public String getContextPath()
Description copied from class:StandardContext
Returns the context path of the web application.- Specified by:
getContextPath
in interfacejakarta.servlet.ServletContext
- Overrides:
getContextPath
in classStandardContext
-
getContext
public jakarta.servlet.ServletContext getContext(String uripath)
Description copied from class:StandardContext
Return aServletContext
object that corresponds to a specified URI on the server.- Specified by:
getContext
in interfacejakarta.servlet.ServletContext
- Overrides:
getContext
in classStandardContext
-
getMajorVersion
public int getMajorVersion()
Description copied from class:StandardContext
Return the major version of the Java Servlet API that we implement.- Specified by:
getMajorVersion
in interfacejakarta.servlet.ServletContext
- Overrides:
getMajorVersion
in classStandardContext
-
getMinorVersion
public int getMinorVersion()
Description copied from class:StandardContext
Return the minor version of the Java Servlet API that we implement.- Specified by:
getMinorVersion
in interfacejakarta.servlet.ServletContext
- Overrides:
getMinorVersion
in classStandardContext
-
getEffectiveMajorVersion
public int getEffectiveMajorVersion()
- Specified by:
getEffectiveMajorVersion
in interfacejakarta.servlet.ServletContext
- Overrides:
getEffectiveMajorVersion
in classStandardContext
-
getEffectiveMinorVersion
public int getEffectiveMinorVersion()
- Specified by:
getEffectiveMinorVersion
in interfacejakarta.servlet.ServletContext
- Overrides:
getEffectiveMinorVersion
in classStandardContext
-
getMimeType
public String getMimeType(String file)
Description copied from class:StandardContext
Return the MIME type of the specified file, ornull
if the MIME type cannot be determined.- Specified by:
getMimeType
in interfacejakarta.servlet.ServletContext
- Overrides:
getMimeType
in classStandardContext
-
getResourcePaths
public Set<String> getResourcePaths(String path)
Description copied from class:StandardContext
Return a Set containing the resource paths of resources member of the specified collection. Each path will be a String starting with a "/" character. The returned set is immutable.- Specified by:
getResourcePaths
in interfacejakarta.servlet.ServletContext
- Overrides:
getResourcePaths
in classStandardContext
-
getResource
public URL getResource(String path) throws MalformedURLException
Description copied from class:StandardContext
Return the URL to the resource that is mapped to a specified path. The path must begin with a "/" and is interpreted as relative to the current context root.- Specified by:
getResource
in interfacejakarta.servlet.ServletContext
- Overrides:
getResource
in classStandardContext
- Throws:
MalformedURLException
-
getResourceAsStream
public InputStream getResourceAsStream(String path)
Description copied from class:StandardContext
Return the requested resource as anInputStream
. The path must be specified according to the rules described undergetResource
. If no such resource can be identified, returnnull
.- Specified by:
getResourceAsStream
in interfacejakarta.servlet.ServletContext
- Overrides:
getResourceAsStream
in classStandardContext
-
getRequestDispatcher
public jakarta.servlet.RequestDispatcher getRequestDispatcher(String path)
Description copied from class:StandardContext
Return aRequestDispatcher
instance that acts as a wrapper for the resource at the given path. The path must begin with a "/" and is interpreted as relative to the current context root.- Specified by:
getRequestDispatcher
in interfacejakarta.servlet.ServletContext
- Overrides:
getRequestDispatcher
in classStandardContext
-
getNamedDispatcher
public jakarta.servlet.RequestDispatcher getNamedDispatcher(String name)
Description copied from class:StandardContext
Return aRequestDispatcher
object that acts as a wrapper for the named servlet.- Specified by:
getNamedDispatcher
in interfacejakarta.servlet.ServletContext
- Overrides:
getNamedDispatcher
in classStandardContext
-
log
public void log(String msg)
Description copied from class:StandardContext
Writes the specified message to a servlet log file.- Specified by:
log
in interfacejakarta.servlet.ServletContext
- Overrides:
log
in classStandardContext
- Parameters:
msg
- Message to be logged
-
log
public void log(String message, Throwable throwable)
Description copied from class:StandardContext
Writes the specified message and exception to a servlet log file.- Specified by:
log
in interfacejakarta.servlet.ServletContext
- Overrides:
log
in classStandardContext
- Parameters:
message
- Message to be loggedthrowable
- Related exception
-
getRealPath
public String getRealPath(String path)
Description copied from class:StandardContext
Return the real path corresponding to the given virtual path, ornull
if the container was unable to perform the translation- Specified by:
getRealPath
in interfacejakarta.servlet.ServletContext
- Overrides:
getRealPath
in classStandardContext
-
getServerInfo
public String getServerInfo()
Description copied from class:StandardContext
Return the name and version of the servlet container.- Specified by:
getServerInfo
in interfacejakarta.servlet.ServletContext
- Overrides:
getServerInfo
in classStandardContext
-
getInitParameter
public String getInitParameter(String name)
Description copied from class:StandardContext
Return the value of the specified initialization parameter, ornull
if this parameter does not exist.- Specified by:
getInitParameter
in interfacejakarta.servlet.ServletContext
- Overrides:
getInitParameter
in classStandardContext
-
getInitParameterNames
public Enumeration<String> getInitParameterNames()
Description copied from class:StandardContext
Return the names of the context's initialization parameters, or an empty enumeration if the context has no initialization parameters.- Specified by:
getInitParameterNames
in interfacejakarta.servlet.ServletContext
- Overrides:
getInitParameterNames
in classStandardContext
-
setInitParameter
public boolean setInitParameter(String name, String value)
- Specified by:
setInitParameter
in interfacejakarta.servlet.ServletContext
- Overrides:
setInitParameter
in classStandardContext
- Returns:
- true if the context initialization parameter with the given name and value was set successfully on this ServletContext, and false if it was not set because this ServletContext already contains a context initialization parameter with a matching name
-
getAttribute
public Object getAttribute(String name)
Description copied from class:StandardContext
Return the value of the specified context attribute, if any; otherwise returnnull
.- Specified by:
getAttribute
in interfacejakarta.servlet.ServletContext
- Overrides:
getAttribute
in classStandardContext
-
getAttributeNames
public Enumeration<String> getAttributeNames()
Description copied from class:StandardContext
Return an enumeration of the names of the context attributes associated with this context.- Specified by:
getAttributeNames
in interfacejakarta.servlet.ServletContext
- Overrides:
getAttributeNames
in classStandardContext
-
setAttribute
public void setAttribute(String name, Object object)
Description copied from class:StandardContext
Bind the specified value with the specified context attribute name, replacing any existing value for that name.- Specified by:
setAttribute
in interfacejakarta.servlet.ServletContext
- Overrides:
setAttribute
in classStandardContext
-
removeAttribute
public void removeAttribute(String name)
Description copied from class:StandardContext
Remove the context attribute with the specified name, if any.- Specified by:
removeAttribute
in interfacejakarta.servlet.ServletContext
- Overrides:
removeAttribute
in classStandardContext
-
getServletContextName
public String getServletContextName()
Description copied from class:StandardContext
Return the display name of this web application.- Specified by:
getServletContextName
in interfacejakarta.servlet.ServletContext
- Overrides:
getServletContextName
in classStandardContext
-
addServlet
public jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, String className)
- Specified by:
addServlet
in interfacejakarta.servlet.ServletContext
- Overrides:
addServlet
in classStandardContext
-
addServletFacade
public jakarta.servlet.ServletRegistration.Dynamic addServletFacade(String servletName, String className)
-
createServletRegistrationImpl
protected ServletRegistrationImpl createServletRegistrationImpl(StandardWrapper wrapper)
- Overrides:
createServletRegistrationImpl
in classWebModule
-
createDynamicServletRegistrationImpl
protected ServletRegistrationImpl createDynamicServletRegistrationImpl(StandardWrapper wrapper)
- Overrides:
createDynamicServletRegistrationImpl
in classWebModule
-
addServlet
public jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass)
- Specified by:
addServlet
in interfacejakarta.servlet.ServletContext
- Overrides:
addServlet
in classStandardContext
-
addServlet
public jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, jakarta.servlet.Servlet servlet)
- Specified by:
addServlet
in interfacejakarta.servlet.ServletContext
- Overrides:
addServlet
in classStandardContext
-
addServletMapping
public Set<String> addServletMapping(String name, String[] urlPatterns)
Description copied from class:StandardContext
Adds the given servlet mappings to this Context.If any of the specified URL patterns are already mapped to a different Servlet, no updates will be performed.
- Overrides:
addServletMapping
in classStandardContext
- Parameters:
name
- the Servlet nameurlPatterns
- the URL patterns- Returns:
- the (possibly empty) Set of URL patterns that are already mapped to a different Servlet
-
createServlet
public <T extends jakarta.servlet.Servlet> T createServlet(Class<T> clazz) throws jakarta.servlet.ServletException
Description copied from class:StandardContext
Instantiates the given Servlet class and performs any required resource injection into the new Servlet instance before returning it.- Specified by:
createServlet
in interfacejakarta.servlet.ServletContext
- Overrides:
createServlet
in classStandardContext
- Throws:
jakarta.servlet.ServletException
-
getServletRegistration
public jakarta.servlet.ServletRegistration getServletRegistration(String servletName)
Description copied from class:StandardContext
Gets the ServletRegistration corresponding to the servlet with the given servletName.- Specified by:
getServletRegistration
in interfacejakarta.servlet.ServletContext
- Overrides:
getServletRegistration
in classStandardContext
-
getServletRegistrations
public Map<String,? extends jakarta.servlet.ServletRegistration> getServletRegistrations()
Description copied from class:StandardContext
Gets a Map of the ServletRegistration objects corresponding to all currently registered servlets.- Specified by:
getServletRegistrations
in interfacejakarta.servlet.ServletContext
- Overrides:
getServletRegistrations
in classStandardContext
-
addFilterFacade
public jakarta.servlet.FilterRegistration.Dynamic addFilterFacade(String filterName, String className)
-
addFilter
public jakarta.servlet.FilterRegistration.Dynamic addFilter(String filterName, String className)
Description copied from class:StandardContext
Adds the filter with the given name and class name to this servlet context.- Specified by:
addFilter
in interfacejakarta.servlet.ServletContext
- Overrides:
addFilter
in classStandardContext
-
addFilterMap
public void addFilterMap(FilterMap filterMap, boolean isMatchAfter)
Description copied from class:StandardContext
Add a filter mapping to this Context.- Overrides:
addFilterMap
in classStandardContext
- Parameters:
filterMap
- The filter mapping to be addedisMatchAfter
- true if the given filter mapping should be matched against requests after any declared filter mappings of this servlet context, and false if it is supposed to be matched before any declared filter mappings of this servlet context
-
addFilter
public jakarta.servlet.FilterRegistration.Dynamic addFilter(String filterName, jakarta.servlet.Filter filter)
- Specified by:
addFilter
in interfacejakarta.servlet.ServletContext
- Overrides:
addFilter
in classStandardContext
-
addFilter
public jakarta.servlet.FilterRegistration.Dynamic addFilter(String filterName, Class<? extends jakarta.servlet.Filter> filterClass)
Description copied from class:StandardContext
Adds the filter with the given name and class type to this servlet context.- Specified by:
addFilter
in interfacejakarta.servlet.ServletContext
- Overrides:
addFilter
in classStandardContext
-
createFilter
public <T extends jakarta.servlet.Filter> T createFilter(Class<T> clazz) throws jakarta.servlet.ServletException
Description copied from class:StandardContext
Instantiates the given Filter class and performs any required resource injection into the new Filter instance before returning it.- Specified by:
createFilter
in interfacejakarta.servlet.ServletContext
- Overrides:
createFilter
in classStandardContext
- Throws:
jakarta.servlet.ServletException
-
getFilterRegistration
public jakarta.servlet.FilterRegistration getFilterRegistration(String filterName)
Description copied from class:StandardContext
Gets the FilterRegistration corresponding to the filter with the given filterName.- Specified by:
getFilterRegistration
in interfacejakarta.servlet.ServletContext
- Overrides:
getFilterRegistration
in classStandardContext
-
getFilterRegistrations
public Map<String,? extends jakarta.servlet.FilterRegistration> getFilterRegistrations()
Description copied from class:StandardContext
Gets a Map of the FilterRegistration objects corresponding to all currently registered filters.- Specified by:
getFilterRegistrations
in interfacejakarta.servlet.ServletContext
- Overrides:
getFilterRegistrations
in classStandardContext
-
getSessionCookieConfig
public jakarta.servlet.SessionCookieConfig getSessionCookieConfig()
Description copied from class:PwcWebModule
Gets the session tracking cookie configuration of this ServletContext.- Specified by:
getSessionCookieConfig
in interfaceContext
- Specified by:
getSessionCookieConfig
in interfacejakarta.servlet.ServletContext
- Overrides:
getSessionCookieConfig
in classPwcWebModule
- Returns:
- the session tracking cookie configuration of this ServletContext.
-
setSessionTrackingModes
public void setSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes)
Description copied from class:StandardContext
Sets the session tracking modes that are to become effective for this ServletContext.- Specified by:
setSessionTrackingModes
in interfacejakarta.servlet.ServletContext
- Overrides:
setSessionTrackingModes
in classStandardContext
-
getDefaultSessionTrackingModes
public Set<jakarta.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
Description copied from class:StandardContext
Gets the session tracking modes that are supported by default for this ServletContext.- Specified by:
getDefaultSessionTrackingModes
in interfacejakarta.servlet.ServletContext
- Overrides:
getDefaultSessionTrackingModes
in classStandardContext
- Returns:
- set of the session tracking modes supported by default for this ServletContext
-
getEffectiveSessionTrackingModes
public Set<jakarta.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
Description copied from class:StandardContext
Gets the session tracking modes that are in effect for this ServletContext.- Specified by:
getEffectiveSessionTrackingModes
in interfacejakarta.servlet.ServletContext
- Overrides:
getEffectiveSessionTrackingModes
in classStandardContext
- Returns:
- set of the session tracking modes in effect for this ServletContext
-
addListener
public void addListener(String className)
Description copied from class:StandardContext
Adds the listener with the given class name to this ServletContext.- Specified by:
addListener
in interfacejakarta.servlet.ServletContext
- Overrides:
addListener
in classStandardContext
- Parameters:
className
- the fully qualified class name of the listener
-
addListener
public <T extends EventListener> void addListener(T t)
Description copied from class:StandardContext
Adds the given listener instance to this ServletContext.- Specified by:
addListener
in interfaceContext
- Specified by:
addListener
in interfacejakarta.servlet.ServletContext
- Overrides:
addListener
in classStandardContext
- Parameters:
t
- the listener to be added
-
addListener
public void addListener(Class<? extends EventListener> listenerClass)
Description copied from class:StandardContext
Adds a listener of the given class type to this ServletContext.- Specified by:
addListener
in interfaceContext
- Specified by:
addListener
in interfacejakarta.servlet.ServletContext
- Overrides:
addListener
in classStandardContext
- Parameters:
listenerClass
- the class from which to instantiate of the listener
-
createListener
public <T extends EventListener> T createListener(Class<T> clazz) throws jakarta.servlet.ServletException
Description copied from class:StandardContext
Instantiates the given EventListener class and performs any required resource injection into the new EventListener instance before returning it.- Specified by:
createListener
in interfacejakarta.servlet.ServletContext
- Overrides:
createListener
in classStandardContext
- Throws:
jakarta.servlet.ServletException
-
getJspConfigDescriptor
public jakarta.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
Description copied from class:StandardContext
Gets the<jsp-config>
related configuration that was aggregated over theweb.xml
andweb-fragment.xml
resources of the web application represented by this ServletContext.- Specified by:
getJspConfigDescriptor
in interfacejakarta.servlet.ServletContext
- Overrides:
getJspConfigDescriptor
in classStandardContext
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from class:StandardContext
Gets the class loader of the web application represented by this ServletContext.- Specified by:
getClassLoader
in interfacejakarta.servlet.ServletContext
- Overrides:
getClassLoader
in classStandardContext
-
declareRoles
public void declareRoles(String... roleNames)
- Specified by:
declareRoles
in interfacejakarta.servlet.ServletContext
- Overrides:
declareRoles
in classWebModule
-
getVirtualServerName
public String getVirtualServerName()
- Specified by:
getVirtualServerName
in interfacejakarta.servlet.ServletContext
- Overrides:
getVirtualServerName
in classStandardContext
-
getPath
public String getPath()
Description copied from class:StandardContext
Return the context path for this Context.
-
setPath
public void setPath(String path)
Description copied from class:StandardContext
Set the context path for this Context.IMPLEMENTATION NOTE: The context path is used as the "name" of a Context, because it must be unique.
-
getDefaultWebXml
public String getDefaultWebXml()
- Overrides:
getDefaultWebXml
in classStandardContext
-
setDefaultWebXml
public void setDefaultWebXml(String defaultWebXml)
Description copied from class:StandardContext
Set the location of the default web xml that will be used. If not absolute, it'll be made relative to the engine's base dir ( which defaults to catalina.base system property ). XXX If a file is not found - we can attempt a getResource()- Specified by:
setDefaultWebXml
in interfaceContext
- Overrides:
setDefaultWebXml
in classStandardContext
- Parameters:
defaultWebXml
- the defaultWebXml path to be used
-
getUnwrappedContext
public WebModule getUnwrappedContext()
Gets the underlying StandardContext to which this ContextFacade is ultimately delegating.- Returns:
- The underlying StandardContext
-
setUnwrappedContext
public void setUnwrappedContext(WebModule wm)
-
setDirectoryListing
public void setDirectoryListing(boolean directoryListing)
Enables or disables directory listings on this Context.- Specified by:
setDirectoryListing
in interfaceContext
- Overrides:
setDirectoryListing
in classStandardContext
- Parameters:
directoryListing
- true if directory listings are to be enabled on this Context, false otherwise
-
isDirectoryListing
public boolean isDirectoryListing()
Description copied from class:StandardContext
Checks whether directory listings are enabled or disabled on this Context.- Specified by:
isDirectoryListing
in interfaceContext
- Overrides:
isDirectoryListing
in classStandardContext
- Returns:
- true if directory listings are enabled on this Context, false otherwise
-
setSecurityConfig
public void setSecurityConfig(SecurityConfig config)
Set the security related configuration for this context- Specified by:
setSecurityConfig
in interfaceContext
- Overrides:
setSecurityConfig
in classWebModule
- Parameters:
config
- the security configuration for this context- See Also:
SecurityConfig
-
getSecurityConfig
public SecurityConfig getSecurityConfig()
Gets the security related configuration for this context- Specified by:
getSecurityConfig
in interfaceContext
- Overrides:
getSecurityConfig
in classWebModule
- Returns:
- the security configuration for this context
- See Also:
SecurityConfig
-
-