Class SecurityWebApplicationContextUtils
java.lang.Object
org.springframework.web.context.support.WebApplicationContextUtils
org.springframework.security.web.context.support.SecurityWebApplicationContextUtils
public abstract class SecurityWebApplicationContextUtils
extends org.springframework.web.context.support.WebApplicationContextUtils
Spring Security extension to Spring's
WebApplicationContextUtils
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.web.context.WebApplicationContext
findRequiredWebApplicationContext
(jakarta.servlet.ServletContext servletContext) Find a uniqueWebApplicationContext
for this web app: either the root web app context (preferred) or a uniqueWebApplicationContext
among the registeredServletContext
attributes (typically coming from a singleDispatcherServlet
in the current web application).Methods inherited from class org.springframework.web.context.support.WebApplicationContextUtils
findWebApplicationContext, getRequiredWebApplicationContext, getWebApplicationContext, getWebApplicationContext, initServletPropertySources, initServletPropertySources, registerEnvironmentBeans, registerEnvironmentBeans, registerWebApplicationScopes, registerWebApplicationScopes
-
Constructor Details
-
SecurityWebApplicationContextUtils
public SecurityWebApplicationContextUtils()
-
-
Method Details
-
findRequiredWebApplicationContext
public static org.springframework.web.context.WebApplicationContext findRequiredWebApplicationContext(jakarta.servlet.ServletContext servletContext) Find a uniqueWebApplicationContext
for this web app: either the root web app context (preferred) or a uniqueWebApplicationContext
among the registeredServletContext
attributes (typically coming from a singleDispatcherServlet
in the current web application).Note that
DispatcherServlet
's exposure of its context can be controlled through itspublishContext
property, which istrue
by default but can be selectively switched to only publish a single context despite multipleDispatcherServlet
registrations in the web app.- Parameters:
servletContext
- ServletContext to find the web application context for- Returns:
- the desired WebApplicationContext for this web app
- Throws:
IllegalStateException
- if no WebApplicationContext can be found- See Also:
-
WebApplicationContextUtils.getWebApplicationContext(ServletContext)
ServletContext.getAttributeNames()
-