Uses of Interface
org.springframework.web.context.WebApplicationContext
Packages that use WebApplicationContext
Package
Description
Contains server-side support for testing Spring MVC applications.
AssertJ support for MockMvc.
Support for testing Spring MVC applications via
RestTestClient 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
Methods in org.springframework.test.web.servlet with parameters of type WebApplicationContextModifier and TypeMethodDescriptionprotected final MockMvcMockMvcBuilderSupport.createMockMvc(jakarta.servlet.Filter[] filters, MockServletConfig servletConfig, WebApplicationContext webAppContext, @Nullable RequestBuilder defaultRequestBuilder, @Nullable Charset defaultResponseCharacterEncoding, List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers, @Nullable List<DispatcherServletCustomizer> dispatcherServletCustomizers) Delegates toMockMvcBuilderSupport.createMockMvc(Filter[], MockServletConfig, WebApplicationContext, RequestBuilder, List, List, List)for creation of theMockMvcinstance and configures that instance with the supplieddefaultResponseCharacterEncoding.protected final MockMvcMockMvcBuilderSupport.createMockMvc(jakarta.servlet.Filter[] filters, MockServletConfig servletConfig, WebApplicationContext webAppContext, @Nullable RequestBuilder defaultRequestBuilder, List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers, @Nullable List<DispatcherServletCustomizer> dispatcherServletCustomizers) -
Uses of WebApplicationContext in org.springframework.test.web.servlet.assertj
Methods in org.springframework.test.web.servlet.assertj with parameters of type WebApplicationContextModifier and TypeMethodDescriptionstatic MockMvcTesterMockMvcTester.from(WebApplicationContext applicationContext) Shortcut to create an instance using the given fully initialized (i.e., refreshed)WebApplicationContext.static MockMvcTesterMockMvcTester.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
Methods in org.springframework.test.web.servlet.client with parameters of type WebApplicationContextModifier and TypeMethodDescriptionstatic MockMvcWebTestClient.MockMvcServerSpec<?> MockMvcWebTestClient.bindToApplicationContext(WebApplicationContext context) Begin creating aWebTestClientby providing aWebApplicationContextwith Spring MVC infrastructure and controllers.RestTestClient.bindToApplicationContext(WebApplicationContext context) Begin creating aRestTestClientwith a WebApplicationContext MockMvc setup. -
Uses of WebApplicationContext in org.springframework.test.web.servlet.htmlunit
Methods in org.springframework.test.web.servlet.htmlunit with parameters of type WebApplicationContextModifier and TypeMethodDescriptionstatic MockMvcWebClientBuilderMockMvcWebClientBuilder.webAppContextSetup(WebApplicationContext context) Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContext.static MockMvcWebClientBuilderMockMvcWebClientBuilder.webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer) Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContextandMockMvcConfigurer.Constructors in org.springframework.test.web.servlet.htmlunit with parameters of type WebApplicationContextModifierConstructorDescriptionprotectedprotectedMockMvcWebClientBuilder(WebApplicationContext context, MockMvcConfigurer configurer) protectedCreate a new instance using the suppliedWebApplicationContext.protectedMockMvcWebConnectionBuilderSupport(WebApplicationContext context, MockMvcConfigurer configurer) Create a new instance using the suppliedWebApplicationContextandMockMvcConfigurer. -
Uses of WebApplicationContext in org.springframework.test.web.servlet.htmlunit.webdriver
Methods in org.springframework.test.web.servlet.htmlunit.webdriver with parameters of type WebApplicationContextModifier and TypeMethodDescriptionstatic MockMvcHtmlUnitDriverBuilderMockMvcHtmlUnitDriverBuilder.webAppContextSetup(WebApplicationContext context) Create a newMockMvcHtmlUnitDriverBuilderbased on the suppliedWebApplicationContext.static MockMvcHtmlUnitDriverBuilderMockMvcHtmlUnitDriverBuilder.webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer) Create a newMockMvcHtmlUnitDriverBuilderbased on the suppliedWebApplicationContextandMockMvcConfigurer.Constructors in org.springframework.test.web.servlet.htmlunit.webdriver with parameters of type WebApplicationContextModifierConstructorDescriptionprotectedprotectedMockMvcHtmlUnitDriverBuilder(WebApplicationContext context, MockMvcConfigurer configurer) -
Uses of WebApplicationContext in org.springframework.test.web.servlet.setup
Methods in org.springframework.test.web.servlet.setup that return WebApplicationContextModifier and TypeMethodDescriptionprotected abstract WebApplicationContextAbstractMockMvcBuilder.initWebAppContext()A method to obtain theWebApplicationContextto be passed to theDispatcherServlet.protected WebApplicationContextDefaultMockMvcBuilder.initWebAppContext()protected WebApplicationContextRouterFunctionMockMvcBuilder.initWebAppContext()protected WebApplicationContextStandaloneMockMvcBuilder.initWebAppContext()Methods in org.springframework.test.web.servlet.setup with parameters of type WebApplicationContextModifier and TypeMethodDescriptiondefault @Nullable RequestPostProcessorMockMvcConfigurer.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 DefaultMockMvcBuilderMockMvcBuilders.webAppContextSetup(WebApplicationContext context) Build aMockMvcinstance using the given, fully initialized (i.e., refreshed)WebApplicationContext.Constructors in org.springframework.test.web.servlet.setup with parameters of type WebApplicationContextModifierConstructorDescriptionprotectedDefaultMockMvcBuilder(WebApplicationContext webAppContext) Protected constructor. -
Uses of WebApplicationContext in org.springframework.web.bind.support
Methods in org.springframework.web.bind.support that return WebApplicationContextModifier and TypeMethodDescriptionprotected WebApplicationContextSpringWebConstraintValidatorFactory.getWebApplicationContext()Retrieve the SpringWebApplicationContextto use. -
Uses of WebApplicationContext in org.springframework.web.context
Subinterfaces of WebApplicationContext in org.springframework.web.contextModifier and TypeInterfaceDescriptioninterfaceInterface to be implemented by configurable web application contexts.Methods in org.springframework.web.context that return WebApplicationContextModifier and TypeMethodDescriptionprotected abstract @Nullable WebApplicationContextAbstractContextLoaderInitializer.createRootApplicationContext()Create the "root" application context to be provided to theContextLoaderListener.protected WebApplicationContextContextLoader.createWebApplicationContext(jakarta.servlet.ServletContext sc) Instantiate the root WebApplicationContext for this loader, either the default context class or a custom context class if specified.static @Nullable WebApplicationContextContextLoader.getCurrentWebApplicationContext()Obtain the Spring root web application context for the current thread (i.e.ContextLoader.initWebApplicationContext(jakarta.servlet.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.Constructors in org.springframework.web.context with parameters of type WebApplicationContextModifierConstructorDescriptionContextLoader(WebApplicationContext rootContext) Create a newContextLoaderwith the given application context.ContextLoaderListener(WebApplicationContext rootContext) Create a newContextLoaderListenerwith the given application context, initializing it with theServletContextEvent-providedServletContextreference which is spec-restricted in terms of capabilities.ContextLoaderListener(WebApplicationContext rootContext, jakarta.servlet.ServletContext servletContext) Create a newContextLoaderListenerwith the given application context. -
Uses of WebApplicationContext in org.springframework.web.context.support
Classes in org.springframework.web.context.support that implement WebApplicationContextModifier and TypeClassDescriptionclassAbstractRefreshableApplicationContextsubclass which implements theConfigurableWebApplicationContextinterface for web environments.classWebApplicationContextimplementation which accepts component classes as input — in particular@Configurationclasses, but also plain@Componentclasses as well as JSR-330 compliant classes usingjakarta.injectannotations.classSubclass ofGenericApplicationContext, suitable for web environments.classWebApplicationContextimplementation which takes its configuration from Groovy bean definition scripts and/or XML files, as understood by aGroovyBeanDefinitionReader.classStaticWebApplicationContextimplementation for testing.classWebApplicationContextimplementation which takes its configuration from XML documents, understood by anXmlBeanDefinitionReader.Methods in org.springframework.web.context.support that return WebApplicationContextModifier and TypeMethodDescriptionstatic @Nullable WebApplicationContextWebApplicationContextUtils.findWebApplicationContext(jakarta.servlet.ServletContext sc) Find a uniqueWebApplicationContextfor this web app: either the root web app context (preferred) or a uniqueWebApplicationContextamong the registeredServletContextattributes (typically coming from a singleDispatcherServletin the current web application).static WebApplicationContextWebApplicationContextUtils.getRequiredWebApplicationContext(jakarta.servlet.ServletContext sc) Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.final WebApplicationContextContextExposingHttpServletRequest.getWebApplicationContext()Return the WebApplicationContext that this request runs in.static @Nullable WebApplicationContextWebApplicationContextUtils.getWebApplicationContext(jakarta.servlet.ServletContext sc) Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.static @Nullable WebApplicationContextWebApplicationContextUtils.getWebApplicationContext(jakarta.servlet.ServletContext sc, String attrName) Find a customWebApplicationContextfor this web app.protected final @Nullable WebApplicationContextWebApplicationObjectSupport.getWebApplicationContext()Return the current application context as WebApplicationContext.Constructors in org.springframework.web.context.support with parameters of type WebApplicationContextModifierConstructorDescriptionContextExposingHttpServletRequest(jakarta.servlet.http.HttpServletRequest originalRequest, WebApplicationContext context) Create a new ContextExposingHttpServletRequest for the given request.ContextExposingHttpServletRequest(jakarta.servlet.http.HttpServletRequest originalRequest, WebApplicationContext context, @Nullable Set<String> exposedContextBeanNames) Create a new ContextExposingHttpServletRequest for the given request. -
Uses of WebApplicationContext in org.springframework.web.filter
Methods in org.springframework.web.filter that return WebApplicationContextModifier and TypeMethodDescriptionprotected @Nullable WebApplicationContextDelegatingFilterProxy.findWebApplicationContext()Return theWebApplicationContextpassed in at construction time, if available.Methods in org.springframework.web.filter with parameters of type WebApplicationContextModifier and TypeMethodDescriptionprotected jakarta.servlet.FilterDelegatingFilterProxy.initDelegate(WebApplicationContext wac) Initialize the Filter delegate, defined as bean the given Spring application context.Constructors in org.springframework.web.filter with parameters of type WebApplicationContextModifierConstructorDescriptionDelegatingFilterProxy(String targetBeanName, @Nullable WebApplicationContext wac) Create a newDelegatingFilterProxythat will retrieve the named target bean from the given SpringWebApplicationContext. -
Uses of WebApplicationContext in org.springframework.web.jsf
Methods in org.springframework.web.jsf that return WebApplicationContextModifier and TypeMethodDescriptionstatic WebApplicationContextFacesContextUtils.getRequiredWebApplicationContext(jakarta.faces.context.FacesContext fc) Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.protected WebApplicationContextDelegatingNavigationHandlerProxy.getWebApplicationContext(jakarta.faces.context.FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.protected WebApplicationContextDelegatingPhaseListenerMulticaster.getWebApplicationContext(jakarta.faces.context.FacesContext facesContext) Retrieve the web application context to delegate bean name resolution to.static @Nullable WebApplicationContextFacesContextUtils.getWebApplicationContext(jakarta.faces.context.FacesContext fc) Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener. -
Uses of WebApplicationContext in org.springframework.web.jsf.el
Methods in org.springframework.web.jsf.el that return WebApplicationContextModifier and TypeMethodDescriptionprotected WebApplicationContextSpringBeanFacesELResolver.getWebApplicationContext(jakarta.el.ELContext elContext) Retrieve the web application context to delegate bean name resolution to.protected @Nullable WebApplicationContextWebApplicationContextFacesELResolver.getWebApplicationContext(jakarta.el.ELContext elContext) Retrieve theWebApplicationContextreference to expose. -
Uses of WebApplicationContext in org.springframework.web.servlet
Methods in org.springframework.web.servlet that return WebApplicationContextModifier and TypeMethodDescriptionprotected WebApplicationContextFrameworkServlet.createWebApplicationContext(@Nullable ApplicationContext parent) Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContextor acustom context class, if set.protected WebApplicationContextFrameworkServlet.createWebApplicationContext(@Nullable WebApplicationContext parent) Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContextor acustom context class, if set.protected @Nullable WebApplicationContextFrameworkServlet.findWebApplicationContext()FrameworkServlet.getWebApplicationContext()Return this servlet's WebApplicationContext.protected WebApplicationContextFrameworkServlet.initWebApplicationContext()Initialize and publish the WebApplicationContext for this servlet.Methods in org.springframework.web.servlet with parameters of type WebApplicationContextModifier and TypeMethodDescriptionprotected WebApplicationContextFrameworkServlet.createWebApplicationContext(@Nullable WebApplicationContext parent) Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContextor acustom context class, if set.Constructors in org.springframework.web.servlet with parameters of type WebApplicationContextModifierConstructorDescriptionDispatcherServlet(WebApplicationContext webApplicationContext) Create a newDispatcherServletwith the given web application context.FrameworkServlet(WebApplicationContext webApplicationContext) Create a newFrameworkServletwith the given web application context. -
Uses of WebApplicationContext in org.springframework.web.servlet.support
Methods in org.springframework.web.servlet.support that return WebApplicationContextModifier and TypeMethodDescriptionprotected @Nullable WebApplicationContextAbstractAnnotationConfigDispatcherServletInitializer.createRootApplicationContext()Create the "root" application context to be provided to theContextLoaderListener.protected WebApplicationContextAbstractAnnotationConfigDispatcherServletInitializer.createServletApplicationContext()Create a servlet application context to be provided to theDispatcherServlet.protected abstract WebApplicationContextAbstractDispatcherServletInitializer.createServletApplicationContext()Create a servlet application context to be provided to theDispatcherServlet.static @Nullable WebApplicationContextRequestContextUtils.findWebApplicationContext(jakarta.servlet.http.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 @Nullable WebApplicationContextRequestContextUtils.findWebApplicationContext(jakarta.servlet.http.HttpServletRequest request, @Nullable jakarta.servlet.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 WebApplicationContextRequestContext.getWebApplicationContext()Return the current WebApplicationContext.Methods in org.springframework.web.servlet.support with parameters of type WebApplicationContextModifier and TypeMethodDescriptionprotected FrameworkServletAbstractDispatcherServletInitializer.createDispatcherServlet(WebApplicationContext servletAppContext) Create aDispatcherServlet(or other kind ofFrameworkServlet-derived dispatcher) with the specifiedWebApplicationContext.