Uses of Interface
org.springframework.web.context.WebApplicationContext
Package
Description
Contains server-side support for testing Spring MVC applications.
AssertJ support for MockMvc.
Support for testing Spring MVC applications via
WebTestClient
with MockMvc
for server request
handling.Server-side support for testing Spring MVC applications with
MockMvc
and HtmlUnit.Server-side support for testing Spring MVC applications with
MockMvc
and the Selenium HtmlUnitDriver
.Contains built-in
MockMvcBuilder
implementations.Support classes for web data binding.
Contains a variant of the application context interface for web applications,
and the ContextLoaderListener that bootstraps a root web application context.
Classes supporting the
org.springframework.web.context
package,
such as WebApplicationContext implementations and various utility classes.Provides generic filter base classes allowing for bean-style configuration.
Support classes for integrating a JSF web layer with a Spring service layer
which is hosted in a Spring root WebApplicationContext.
ELResolvers for integrating a JSF web layer with a Spring service layer
which is hosted in a Spring root WebApplicationContext.
Provides servlets that integrate with the application context
infrastructure, and the core interfaces and classes for the
Spring web MVC framework.
Support classes for Spring's web MVC framework.
-
Uses of WebApplicationContext in org.springframework.test.web.servlet
Modifier and TypeMethodDescriptionprotected final MockMvc
MockMvcBuilderSupport.createMockMvc
(Filter[] filters, MockServletConfig servletConfig, WebApplicationContext webAppContext, RequestBuilder defaultRequestBuilder, Charset defaultResponseCharacterEncoding, List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers, List<DispatcherServletCustomizer> dispatcherServletCustomizers) Delegates toMockMvcBuilderSupport.createMockMvc(Filter[], MockServletConfig, WebApplicationContext, RequestBuilder, List, List, List)
for creation of theMockMvc
instance and configures that instance with the supplieddefaultResponseCharacterEncoding
.protected final MockMvc
MockMvcBuilderSupport.createMockMvc
(Filter[] filters, MockServletConfig servletConfig, WebApplicationContext webAppContext, RequestBuilder defaultRequestBuilder, List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers, List<DispatcherServletCustomizer> dispatcherServletCustomizers) -
Uses of WebApplicationContext in org.springframework.test.web.servlet.assertj
Modifier and TypeMethodDescriptionstatic MockMvcTester
MockMvcTester.from
(WebApplicationContext applicationContext) Shortcut to create an instance using the given fully initialized (i.e., refreshed)WebApplicationContext
.static MockMvcTester
MockMvcTester.from
(WebApplicationContext applicationContext, Function<DefaultMockMvcBuilder, MockMvc> customizations) Create an instance using the given, fully initialized (i.e., refreshed)WebApplicationContext
. -
Uses of WebApplicationContext in org.springframework.test.web.servlet.client
Modifier and TypeMethodDescriptionstatic MockMvcWebTestClient.MockMvcServerSpec<?>
MockMvcWebTestClient.bindToApplicationContext
(WebApplicationContext context) Begin creating aWebTestClient
by providing aWebApplicationContext
with Spring MVC infrastructure and controllers. -
Uses of WebApplicationContext in org.springframework.test.web.servlet.htmlunit
Modifier and TypeMethodDescriptionstatic MockMvcWebClientBuilder
MockMvcWebClientBuilder.webAppContextSetup
(WebApplicationContext context) Create a newMockMvcWebClientBuilder
based on the suppliedWebApplicationContext
.static MockMvcWebClientBuilder
MockMvcWebClientBuilder.webAppContextSetup
(WebApplicationContext context, MockMvcConfigurer configurer) Create a newMockMvcWebClientBuilder
based on the suppliedWebApplicationContext
andMockMvcConfigurer
.ModifierConstructorDescriptionprotected
protected
MockMvcWebClientBuilder
(WebApplicationContext context, MockMvcConfigurer configurer) protected
Create a new instance using the suppliedWebApplicationContext
.protected
MockMvcWebConnectionBuilderSupport
(WebApplicationContext context, MockMvcConfigurer configurer) Create a new instance using the suppliedWebApplicationContext
andMockMvcConfigurer
. -
Uses of WebApplicationContext in org.springframework.test.web.servlet.htmlunit.webdriver
Modifier and TypeMethodDescriptionstatic MockMvcHtmlUnitDriverBuilder
MockMvcHtmlUnitDriverBuilder.webAppContextSetup
(WebApplicationContext context) Create a newMockMvcHtmlUnitDriverBuilder
based on the suppliedWebApplicationContext
.static MockMvcHtmlUnitDriverBuilder
MockMvcHtmlUnitDriverBuilder.webAppContextSetup
(WebApplicationContext context, MockMvcConfigurer configurer) Create a newMockMvcHtmlUnitDriverBuilder
based on the suppliedWebApplicationContext
andMockMvcConfigurer
.ModifierConstructorDescriptionprotected
protected
MockMvcHtmlUnitDriverBuilder
(WebApplicationContext context, MockMvcConfigurer configurer) -
Uses of WebApplicationContext in org.springframework.test.web.servlet.setup
Modifier and TypeMethodDescriptionprotected abstract WebApplicationContext
AbstractMockMvcBuilder.initWebAppContext()
A method to obtain theWebApplicationContext
to be passed to theDispatcherServlet
.protected WebApplicationContext
DefaultMockMvcBuilder.initWebAppContext()
protected WebApplicationContext
RouterFunctionMockMvcBuilder.initWebAppContext()
protected WebApplicationContext
StandaloneMockMvcBuilder.initWebAppContext()
Modifier and TypeMethodDescriptiondefault RequestPostProcessor
MockMvcConfigurer.beforeMockMvcCreated
(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context) Invoked when the MockMvc instance is about to be created with the MockMvc builder and the Spring WebApplicationContext that will be passed to theDispatcherServlet
.MockMvcConfigurerAdapter.beforeMockMvcCreated
(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext cxt) SharedHttpSessionConfigurer.beforeMockMvcCreated
(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context) static DefaultMockMvcBuilder
MockMvcBuilders.webAppContextSetup
(WebApplicationContext context) Build aMockMvc
instance using the given, fully initialized (i.e., refreshed)WebApplicationContext
.ModifierConstructorDescriptionprotected
DefaultMockMvcBuilder
(WebApplicationContext webAppContext) Protected constructor. -
Uses of WebApplicationContext in org.springframework.web.bind.support
Modifier and TypeMethodDescriptionprotected WebApplicationContext
SpringWebConstraintValidatorFactory.getWebApplicationContext()
Retrieve the SpringWebApplicationContext
to use. -
Uses of WebApplicationContext in org.springframework.web.context
Modifier and TypeInterfaceDescriptioninterface
Interface to be implemented by configurable web application contexts.Modifier and TypeMethodDescriptionprotected abstract WebApplicationContext
AbstractContextLoaderInitializer.createRootApplicationContext()
Create the "root" application context to be provided to theContextLoaderListener
.protected WebApplicationContext
ContextLoader.createWebApplicationContext
(ServletContext sc) Instantiate the root WebApplicationContext for this loader, either the default context class or a custom context class if specified.static WebApplicationContext
ContextLoader.getCurrentWebApplicationContext()
Obtain the Spring root web application context for the current thread (i.e.ContextLoader.initWebApplicationContext
(ServletContext servletContext) Initialize Spring's web application context for the given servlet context, using the application context provided at construction time, or creating a new one according to the "contextClass
" and "contextConfigLocation
" context-params.ModifierConstructorDescriptionContextLoader
(WebApplicationContext context) Create a newContextLoader
with the given application context.Create a newContextLoaderListener
with the given application context. -
Uses of WebApplicationContext in org.springframework.web.context.support
Modifier and TypeClassDescriptionclass
AbstractRefreshableApplicationContext
subclass which implements theConfigurableWebApplicationContext
interface for web environments.class
WebApplicationContext
implementation which accepts component classes as input — in particular@Configuration
classes, but also plain@Component
classes as well as JSR-330 compliant classes usingjakarta.inject
annotations.class
Subclass ofGenericApplicationContext
, suitable for web environments.class
WebApplicationContext
implementation which takes its configuration from Groovy bean definition scripts and/or XML files, as understood by aGroovyBeanDefinitionReader
.class
StaticWebApplicationContext
implementation for testing.class
WebApplicationContext
implementation which takes its configuration from XML documents, understood by anXmlBeanDefinitionReader
.Modifier and TypeMethodDescriptionstatic WebApplicationContext
WebApplicationContextUtils.findWebApplicationContext
(ServletContext sc) 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).static WebApplicationContext
WebApplicationContextUtils.getRequiredWebApplicationContext
(ServletContext sc) Find the rootWebApplicationContext
for this web app, typically loaded viaContextLoaderListener
.final WebApplicationContext
ContextExposingHttpServletRequest.getWebApplicationContext()
Return the WebApplicationContext that this request runs in.static WebApplicationContext
WebApplicationContextUtils.getWebApplicationContext
(ServletContext sc) Find the rootWebApplicationContext
for this web app, typically loaded viaContextLoaderListener
.static WebApplicationContext
WebApplicationContextUtils.getWebApplicationContext
(ServletContext sc, String attrName) Find a customWebApplicationContext
for this web app.protected final WebApplicationContext
WebApplicationObjectSupport.getWebApplicationContext()
Return the current application context as WebApplicationContext.ModifierConstructorDescriptionContextExposingHttpServletRequest
(HttpServletRequest originalRequest, WebApplicationContext context) Create a new ContextExposingHttpServletRequest for the given request.ContextExposingHttpServletRequest
(HttpServletRequest originalRequest, WebApplicationContext context, Set<String> exposedContextBeanNames) Create a new ContextExposingHttpServletRequest for the given request. -
Uses of WebApplicationContext in org.springframework.web.filter
Modifier and TypeMethodDescriptionprotected WebApplicationContext
DelegatingFilterProxy.findWebApplicationContext()
Return theWebApplicationContext
passed in at construction time, if available.Modifier and TypeMethodDescriptionprotected Filter
DelegatingFilterProxy.initDelegate
(WebApplicationContext wac) Initialize the Filter delegate, defined as bean the given Spring application context.ModifierConstructorDescriptionDelegatingFilterProxy
(String targetBeanName, WebApplicationContext wac) Create a newDelegatingFilterProxy
that will retrieve the named target bean from the given SpringWebApplicationContext
. -
Uses of WebApplicationContext in org.springframework.web.jsf
Modifier and TypeMethodDescriptionstatic WebApplicationContext
FacesContextUtils.getRequiredWebApplicationContext
(FacesContext fc) Find the rootWebApplicationContext
for this web app, typically loaded viaContextLoaderListener
.protected WebApplicationContext
DelegatingNavigationHandlerProxy.getWebApplicationContext
(FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.protected WebApplicationContext
DelegatingPhaseListenerMulticaster.getWebApplicationContext
(FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.static WebApplicationContext
FacesContextUtils.getWebApplicationContext
(FacesContext fc) Find the rootWebApplicationContext
for this web app, typically loaded viaContextLoaderListener
. -
Uses of WebApplicationContext in org.springframework.web.jsf.el
Modifier and TypeMethodDescriptionprotected WebApplicationContext
SpringBeanFacesELResolver.getWebApplicationContext
(ELContext elContext) Retrieve the web application context to delegate bean name resolution to.protected WebApplicationContext
WebApplicationContextFacesELResolver.getWebApplicationContext
(ELContext elContext) Retrieve theWebApplicationContext
reference to expose. -
Uses of WebApplicationContext in org.springframework.web.servlet
Modifier and TypeMethodDescriptionprotected WebApplicationContext
FrameworkServlet.createWebApplicationContext
(ApplicationContext parent) Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContext
or acustom context class
, if set.protected WebApplicationContext
FrameworkServlet.createWebApplicationContext
(WebApplicationContext parent) Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContext
or acustom context class
, if set.protected WebApplicationContext
FrameworkServlet.findWebApplicationContext()
final WebApplicationContext
FrameworkServlet.getWebApplicationContext()
Return this servlet's WebApplicationContext.protected WebApplicationContext
FrameworkServlet.initWebApplicationContext()
Initialize and publish the WebApplicationContext for this servlet.Modifier and TypeMethodDescriptionprotected WebApplicationContext
FrameworkServlet.createWebApplicationContext
(WebApplicationContext parent) Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContext
or acustom context class
, if set.ModifierConstructorDescriptionDispatcherServlet
(WebApplicationContext webApplicationContext) Create a newDispatcherServlet
with the given web application context.FrameworkServlet
(WebApplicationContext webApplicationContext) Create a newFrameworkServlet
with the given web application context. -
Uses of WebApplicationContext in org.springframework.web.servlet.support
Modifier and TypeMethodDescriptionprotected WebApplicationContext
AbstractAnnotationConfigDispatcherServletInitializer.createRootApplicationContext()
Create the "root" application context to be provided to theContextLoaderListener
.protected WebApplicationContext
AbstractAnnotationConfigDispatcherServletInitializer.createServletApplicationContext()
Create a servlet application context to be provided to theDispatcherServlet
.protected abstract WebApplicationContext
AbstractDispatcherServletInitializer.createServletApplicationContext()
Create a servlet application context to be provided to theDispatcherServlet
.static WebApplicationContext
RequestContextUtils.findWebApplicationContext
(HttpServletRequest request) Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing, and for the global context if none was found associated with the current request.static WebApplicationContext
RequestContextUtils.findWebApplicationContext
(HttpServletRequest request, ServletContext servletContext) Look for the WebApplicationContext associated with the DispatcherServlet that has initiated request processing, and for the global context if none was found associated with the current request.final WebApplicationContext
RequestContext.getWebApplicationContext()
Return the current WebApplicationContext.Modifier and TypeMethodDescriptionprotected FrameworkServlet
AbstractDispatcherServletInitializer.createDispatcherServlet
(WebApplicationContext servletAppContext) Create aDispatcherServlet
(or other kind ofFrameworkServlet
-derived dispatcher) with the specifiedWebApplicationContext
.