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.DynamicaddFilter(String filterName, jakarta.servlet.Filter filter)jakarta.servlet.FilterRegistration.DynamicaddFilter(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.DynamicaddFilter(String filterName, String className)Adds the filter with the given name and class name to this servlet context.jakarta.servlet.FilterRegistration.DynamicaddFilterFacade(String filterName, String className)voidaddFilterMap(FilterMap filterMap, boolean isMatchAfter)Add a filter mapping to this Context.voidaddListener(Class<? extends EventListener> listenerClass)Adds a listener of the given class type to this ServletContext.voidaddListener(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.DynamicaddServlet(String servletName, jakarta.servlet.Servlet servlet)jakarta.servlet.ServletRegistration.DynamicaddServlet(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass)jakarta.servlet.ServletRegistration.DynamicaddServlet(String servletName, String className)jakarta.servlet.ServletRegistration.DynamicaddServletFacade(String servletName, String className)Set<String>addServletMapping(String name, String[] urlPatterns)Adds the given servlet mappings to this Context.protected ServletRegistrationImplcreateDynamicServletRegistrationImpl(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 ServletRegistrationImplcreateServletRegistrationImpl(StandardWrapper wrapper)voiddeclareRoles(String... roleNames)Map<String,String>getAddedFilters()Map<String,String>getAddedServlets()Returns previously added servletsStringgetAppName()ObjectgetAttribute(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.ClassLoadergetClassLoader()Gets the class loader of the web application represented by this ServletContext.jakarta.servlet.ServletContextgetContext(String uripath)Return aServletContextobject that corresponds to a specified URI on the server.StringgetContextPath()Returns the context path of the web application.StringgetContextRoot()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.StringgetDefaultWebXml()FilegetDocRoot()intgetEffectiveMajorVersion()intgetEffectiveMinorVersion()Set<jakarta.servlet.SessionTrackingMode>getEffectiveSessionTrackingModes()Gets the session tracking modes that are in effect for this ServletContext.jakarta.servlet.FilterRegistrationgetFilterRegistration(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.StringgetInitParameter(String name)Return the value of the specified initialization parameter, ornullif 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.JspConfigDescriptorgetJspConfigDescriptor()Gets the<jsp-config>related configuration that was aggregated over theweb.xmlandweb-fragment.xmlresources of the web application represented by this ServletContext.List<String>getListeners()intgetMajorVersion()Return the major version of the Java Servlet API that we implement.StringgetMimeType(String file)Return the MIME type of the specified file, ornullif the MIME type cannot be determined.intgetMinorVersion()Return the minor version of the Java Servlet API that we implement.jakarta.servlet.RequestDispatchergetNamedDispatcher(String name)Return aRequestDispatcherobject that acts as a wrapper for the named servlet.StringgetPath()Return the context path for this Context.StringgetRealPath(String path)Return the real path corresponding to the given virtual path, ornullif the container was unable to perform the translationjakarta.servlet.RequestDispatchergetRequestDispatcher(String path)Return aRequestDispatcherinstance that acts as a wrapper for the resource at the given path.URLgetResource(String path)Return the URL to the resource that is mapped to a specified path.InputStreamgetResourceAsStream(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.SecurityConfiggetSecurityConfig()Gets the security related configuration for this contextStringgetServerInfo()Return the name and version of the servlet container.StringgetServletContextName()Return the display name of this web application.Map<String,String[]>getServletMappings()Map<String,String>getServletNameFilterMappings()jakarta.servlet.ServletRegistrationgetServletRegistration(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.SessionCookieConfiggetSessionCookieConfig()Gets the session tracking cookie configuration of this ServletContext.WebModulegetUnwrappedContext()Gets the underlying StandardContext to which this ContextFacade is ultimately delegating.Map<String,String>getUrlPatternFilterMappings()StringgetVirtualServerName()booleanisDirectoryListing()Checks whether directory listings are enabled or disabled on this Context.voidlog(String msg)Writes the specified message to a servlet log file.voidlog(String message, Throwable throwable)Writes the specified message and exception to a servlet log file.voidremoveAttribute(String name)Remove the context attribute with the specified name, if any.voidsetAppName(String name)voidsetAttribute(String name, Object object)Bind the specified value with the specified context attribute name, replacing any existing value for that name.voidsetDefaultWebXml(String defaultWebXml)Set the location of the default web xml that will be used.voidsetDirectoryListing(boolean directoryListing)Enables or disables directory listings on this Context.booleansetInitParameter(String name, String value)voidsetPath(String path)Set the context path for this Context.voidsetSecurityConfig(SecurityConfig config)Set the security related configuration for this contextvoidsetSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes)Sets the session tracking modes that are to become effective for this ServletContext.voidsetUnwrappedContext(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:PwcWebModuleGets this web module's context root.- Overrides:
getContextRootin classPwcWebModule- Returns:
- Web module context root
-
getDocRoot
public File getDocRoot()
-
getContextPath
public String getContextPath()
Description copied from class:StandardContextReturns the context path of the web application.- Specified by:
getContextPathin interfacejakarta.servlet.ServletContext- Overrides:
getContextPathin classStandardContext
-
getContext
public jakarta.servlet.ServletContext getContext(String uripath)
Description copied from class:StandardContextReturn aServletContextobject that corresponds to a specified URI on the server.- Specified by:
getContextin interfacejakarta.servlet.ServletContext- Overrides:
getContextin classStandardContext
-
getMajorVersion
public int getMajorVersion()
Description copied from class:StandardContextReturn the major version of the Java Servlet API that we implement.- Specified by:
getMajorVersionin interfacejakarta.servlet.ServletContext- Overrides:
getMajorVersionin classStandardContext
-
getMinorVersion
public int getMinorVersion()
Description copied from class:StandardContextReturn the minor version of the Java Servlet API that we implement.- Specified by:
getMinorVersionin interfacejakarta.servlet.ServletContext- Overrides:
getMinorVersionin classStandardContext
-
getEffectiveMajorVersion
public int getEffectiveMajorVersion()
- Specified by:
getEffectiveMajorVersionin interfacejakarta.servlet.ServletContext- Overrides:
getEffectiveMajorVersionin classStandardContext
-
getEffectiveMinorVersion
public int getEffectiveMinorVersion()
- Specified by:
getEffectiveMinorVersionin interfacejakarta.servlet.ServletContext- Overrides:
getEffectiveMinorVersionin classStandardContext
-
getMimeType
public String getMimeType(String file)
Description copied from class:StandardContextReturn the MIME type of the specified file, ornullif the MIME type cannot be determined.- Specified by:
getMimeTypein interfacejakarta.servlet.ServletContext- Overrides:
getMimeTypein classStandardContext
-
getResourcePaths
public Set<String> getResourcePaths(String path)
Description copied from class:StandardContextReturn 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:
getResourcePathsin interfacejakarta.servlet.ServletContext- Overrides:
getResourcePathsin classStandardContext
-
getResource
public URL getResource(String path) throws MalformedURLException
Description copied from class:StandardContextReturn 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:
getResourcein interfacejakarta.servlet.ServletContext- Overrides:
getResourcein classStandardContext- Throws:
MalformedURLException
-
getResourceAsStream
public InputStream getResourceAsStream(String path)
Description copied from class:StandardContextReturn 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:
getResourceAsStreamin interfacejakarta.servlet.ServletContext- Overrides:
getResourceAsStreamin classStandardContext
-
getRequestDispatcher
public jakarta.servlet.RequestDispatcher getRequestDispatcher(String path)
Description copied from class:StandardContextReturn aRequestDispatcherinstance 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:
getRequestDispatcherin interfacejakarta.servlet.ServletContext- Overrides:
getRequestDispatcherin classStandardContext
-
getNamedDispatcher
public jakarta.servlet.RequestDispatcher getNamedDispatcher(String name)
Description copied from class:StandardContextReturn aRequestDispatcherobject that acts as a wrapper for the named servlet.- Specified by:
getNamedDispatcherin interfacejakarta.servlet.ServletContext- Overrides:
getNamedDispatcherin classStandardContext
-
log
public void log(String msg)
Description copied from class:StandardContextWrites the specified message to a servlet log file.- Specified by:
login interfacejakarta.servlet.ServletContext- Overrides:
login classStandardContext- Parameters:
msg- Message to be logged
-
log
public void log(String message, Throwable throwable)
Description copied from class:StandardContextWrites the specified message and exception to a servlet log file.- Specified by:
login interfacejakarta.servlet.ServletContext- Overrides:
login classStandardContext- Parameters:
message- Message to be loggedthrowable- Related exception
-
getRealPath
public String getRealPath(String path)
Description copied from class:StandardContextReturn the real path corresponding to the given virtual path, ornullif the container was unable to perform the translation- Specified by:
getRealPathin interfacejakarta.servlet.ServletContext- Overrides:
getRealPathin classStandardContext
-
getServerInfo
public String getServerInfo()
Description copied from class:StandardContextReturn the name and version of the servlet container.- Specified by:
getServerInfoin interfacejakarta.servlet.ServletContext- Overrides:
getServerInfoin classStandardContext
-
getInitParameter
public String getInitParameter(String name)
Description copied from class:StandardContextReturn the value of the specified initialization parameter, ornullif this parameter does not exist.- Specified by:
getInitParameterin interfacejakarta.servlet.ServletContext- Overrides:
getInitParameterin classStandardContext
-
getInitParameterNames
public Enumeration<String> getInitParameterNames()
Description copied from class:StandardContextReturn the names of the context's initialization parameters, or an empty enumeration if the context has no initialization parameters.- Specified by:
getInitParameterNamesin interfacejakarta.servlet.ServletContext- Overrides:
getInitParameterNamesin classStandardContext
-
setInitParameter
public boolean setInitParameter(String name, String value)
- Specified by:
setInitParameterin interfacejakarta.servlet.ServletContext- Overrides:
setInitParameterin 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:StandardContextReturn the value of the specified context attribute, if any; otherwise returnnull.- Specified by:
getAttributein interfacejakarta.servlet.ServletContext- Overrides:
getAttributein classStandardContext
-
getAttributeNames
public Enumeration<String> getAttributeNames()
Description copied from class:StandardContextReturn an enumeration of the names of the context attributes associated with this context.- Specified by:
getAttributeNamesin interfacejakarta.servlet.ServletContext- Overrides:
getAttributeNamesin classStandardContext
-
setAttribute
public void setAttribute(String name, Object object)
Description copied from class:StandardContextBind the specified value with the specified context attribute name, replacing any existing value for that name.- Specified by:
setAttributein interfacejakarta.servlet.ServletContext- Overrides:
setAttributein classStandardContext
-
removeAttribute
public void removeAttribute(String name)
Description copied from class:StandardContextRemove the context attribute with the specified name, if any.- Specified by:
removeAttributein interfacejakarta.servlet.ServletContext- Overrides:
removeAttributein classStandardContext
-
getServletContextName
public String getServletContextName()
Description copied from class:StandardContextReturn the display name of this web application.- Specified by:
getServletContextNamein interfacejakarta.servlet.ServletContext- Overrides:
getServletContextNamein classStandardContext
-
addServlet
public jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, String className)
- Specified by:
addServletin interfacejakarta.servlet.ServletContext- Overrides:
addServletin classStandardContext
-
addServletFacade
public jakarta.servlet.ServletRegistration.Dynamic addServletFacade(String servletName, String className)
-
createServletRegistrationImpl
protected ServletRegistrationImpl createServletRegistrationImpl(StandardWrapper wrapper)
- Overrides:
createServletRegistrationImplin classWebModule
-
createDynamicServletRegistrationImpl
protected ServletRegistrationImpl createDynamicServletRegistrationImpl(StandardWrapper wrapper)
- Overrides:
createDynamicServletRegistrationImplin classWebModule
-
addServlet
public jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, Class<? extends jakarta.servlet.Servlet> servletClass)
- Specified by:
addServletin interfacejakarta.servlet.ServletContext- Overrides:
addServletin classStandardContext
-
addServlet
public jakarta.servlet.ServletRegistration.Dynamic addServlet(String servletName, jakarta.servlet.Servlet servlet)
- Specified by:
addServletin interfacejakarta.servlet.ServletContext- Overrides:
addServletin classStandardContext
-
addServletMapping
public Set<String> addServletMapping(String name, String[] urlPatterns)
Description copied from class:StandardContextAdds 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:
addServletMappingin 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:StandardContextInstantiates the given Servlet class and performs any required resource injection into the new Servlet instance before returning it.- Specified by:
createServletin interfacejakarta.servlet.ServletContext- Overrides:
createServletin classStandardContext- Throws:
jakarta.servlet.ServletException
-
getServletRegistration
public jakarta.servlet.ServletRegistration getServletRegistration(String servletName)
Description copied from class:StandardContextGets the ServletRegistration corresponding to the servlet with the given servletName.- Specified by:
getServletRegistrationin interfacejakarta.servlet.ServletContext- Overrides:
getServletRegistrationin classStandardContext
-
getServletRegistrations
public Map<String,? extends jakarta.servlet.ServletRegistration> getServletRegistrations()
Description copied from class:StandardContextGets a Map of the ServletRegistration objects corresponding to all currently registered servlets.- Specified by:
getServletRegistrationsin interfacejakarta.servlet.ServletContext- Overrides:
getServletRegistrationsin 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:StandardContextAdds the filter with the given name and class name to this servlet context.- Specified by:
addFilterin interfacejakarta.servlet.ServletContext- Overrides:
addFilterin classStandardContext
-
addFilterMap
public void addFilterMap(FilterMap filterMap, boolean isMatchAfter)
Description copied from class:StandardContextAdd a filter mapping to this Context.- Overrides:
addFilterMapin 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:
addFilterin interfacejakarta.servlet.ServletContext- Overrides:
addFilterin classStandardContext
-
addFilter
public jakarta.servlet.FilterRegistration.Dynamic addFilter(String filterName, Class<? extends jakarta.servlet.Filter> filterClass)
Description copied from class:StandardContextAdds the filter with the given name and class type to this servlet context.- Specified by:
addFilterin interfacejakarta.servlet.ServletContext- Overrides:
addFilterin classStandardContext
-
createFilter
public <T extends jakarta.servlet.Filter> T createFilter(Class<T> clazz) throws jakarta.servlet.ServletException
Description copied from class:StandardContextInstantiates the given Filter class and performs any required resource injection into the new Filter instance before returning it.- Specified by:
createFilterin interfacejakarta.servlet.ServletContext- Overrides:
createFilterin classStandardContext- Throws:
jakarta.servlet.ServletException
-
getFilterRegistration
public jakarta.servlet.FilterRegistration getFilterRegistration(String filterName)
Description copied from class:StandardContextGets the FilterRegistration corresponding to the filter with the given filterName.- Specified by:
getFilterRegistrationin interfacejakarta.servlet.ServletContext- Overrides:
getFilterRegistrationin classStandardContext
-
getFilterRegistrations
public Map<String,? extends jakarta.servlet.FilterRegistration> getFilterRegistrations()
Description copied from class:StandardContextGets a Map of the FilterRegistration objects corresponding to all currently registered filters.- Specified by:
getFilterRegistrationsin interfacejakarta.servlet.ServletContext- Overrides:
getFilterRegistrationsin classStandardContext
-
getSessionCookieConfig
public jakarta.servlet.SessionCookieConfig getSessionCookieConfig()
Description copied from class:PwcWebModuleGets the session tracking cookie configuration of this ServletContext.- Specified by:
getSessionCookieConfigin interfaceContext- Specified by:
getSessionCookieConfigin interfacejakarta.servlet.ServletContext- Overrides:
getSessionCookieConfigin classPwcWebModule- Returns:
- the session tracking cookie configuration of this ServletContext.
-
setSessionTrackingModes
public void setSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes)
Description copied from class:StandardContextSets the session tracking modes that are to become effective for this ServletContext.- Specified by:
setSessionTrackingModesin interfacejakarta.servlet.ServletContext- Overrides:
setSessionTrackingModesin classStandardContext
-
getDefaultSessionTrackingModes
public Set<jakarta.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
Description copied from class:StandardContextGets the session tracking modes that are supported by default for this ServletContext.- Specified by:
getDefaultSessionTrackingModesin interfacejakarta.servlet.ServletContext- Overrides:
getDefaultSessionTrackingModesin 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:StandardContextGets the session tracking modes that are in effect for this ServletContext.- Specified by:
getEffectiveSessionTrackingModesin interfacejakarta.servlet.ServletContext- Overrides:
getEffectiveSessionTrackingModesin classStandardContext- Returns:
- set of the session tracking modes in effect for this ServletContext
-
addListener
public void addListener(String className)
Description copied from class:StandardContextAdds the listener with the given class name to this ServletContext.- Specified by:
addListenerin interfacejakarta.servlet.ServletContext- Overrides:
addListenerin classStandardContext- Parameters:
className- the fully qualified class name of the listener
-
addListener
public <T extends EventListener> void addListener(T t)
Description copied from class:StandardContextAdds the given listener instance to this ServletContext.- Specified by:
addListenerin interfaceContext- Specified by:
addListenerin interfacejakarta.servlet.ServletContext- Overrides:
addListenerin classStandardContext- Parameters:
t- the listener to be added
-
addListener
public void addListener(Class<? extends EventListener> listenerClass)
Description copied from class:StandardContextAdds a listener of the given class type to this ServletContext.- Specified by:
addListenerin interfaceContext- Specified by:
addListenerin interfacejakarta.servlet.ServletContext- Overrides:
addListenerin 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:StandardContextInstantiates the given EventListener class and performs any required resource injection into the new EventListener instance before returning it.- Specified by:
createListenerin interfacejakarta.servlet.ServletContext- Overrides:
createListenerin classStandardContext- Throws:
jakarta.servlet.ServletException
-
getJspConfigDescriptor
public jakarta.servlet.descriptor.JspConfigDescriptor getJspConfigDescriptor()
Description copied from class:StandardContextGets the<jsp-config>related configuration that was aggregated over theweb.xmlandweb-fragment.xmlresources of the web application represented by this ServletContext.- Specified by:
getJspConfigDescriptorin interfacejakarta.servlet.ServletContext- Overrides:
getJspConfigDescriptorin classStandardContext
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from class:StandardContextGets the class loader of the web application represented by this ServletContext.- Specified by:
getClassLoaderin interfacejakarta.servlet.ServletContext- Overrides:
getClassLoaderin classStandardContext
-
declareRoles
public void declareRoles(String... roleNames)
- Specified by:
declareRolesin interfacejakarta.servlet.ServletContext- Overrides:
declareRolesin classWebModule
-
getVirtualServerName
public String getVirtualServerName()
- Specified by:
getVirtualServerNamein interfacejakarta.servlet.ServletContext- Overrides:
getVirtualServerNamein classStandardContext
-
getPath
public String getPath()
Description copied from class:StandardContextReturn the context path for this Context.
-
setPath
public void setPath(String path)
Description copied from class:StandardContextSet 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:
getDefaultWebXmlin classStandardContext
-
setDefaultWebXml
public void setDefaultWebXml(String defaultWebXml)
Description copied from class:StandardContextSet 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:
setDefaultWebXmlin interfaceContext- Overrides:
setDefaultWebXmlin 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:
setDirectoryListingin interfaceContext- Overrides:
setDirectoryListingin classStandardContext- Parameters:
directoryListing- true if directory listings are to be enabled on this Context, false otherwise
-
isDirectoryListing
public boolean isDirectoryListing()
Description copied from class:StandardContextChecks whether directory listings are enabled or disabled on this Context.- Specified by:
isDirectoryListingin interfaceContext- Overrides:
isDirectoryListingin 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:
setSecurityConfigin interfaceContext- Overrides:
setSecurityConfigin 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:
getSecurityConfigin interfaceContext- Overrides:
getSecurityConfigin classWebModule- Returns:
- the security configuration for this context
- See Also:
SecurityConfig
-
-