接口的使用
org.springframework.web.context.WebApplicationContext
使用WebApplicationContext的程序包 程序包 说明 org.springframework.test.web.servlet Contains server-side support for testing Spring MVC applications.org.springframework.test.web.servlet.htmlunit Server-side support for testing Spring MVC applications withMockMvcand HtmlUnit.org.springframework.test.web.servlet.htmlunit.webdriver Server-side support for testing Spring MVC applications withMockMvcand the SeleniumHtmlUnitDriver.org.springframework.test.web.servlet.setup Contains built-inMockMvcBuilderimplementations.org.springframework.web.bind.support Support classes for web data binding.org.springframework.web.context Contains a variant of the application context interface for web applications, and the ContextLoaderListener that bootstraps a root web application context.org.springframework.web.context.support Classes supporting theorg.springframework.web.contextpackage, such as WebApplicationContext implementations and various utility classes.org.springframework.web.filter Provides generic filter base classes allowing for bean-style configuration.org.springframework.web.jsf Support classes for integrating a JSF web layer with a Spring service layer which is hosted in a Spring root WebApplicationContext.org.springframework.web.jsf.el ELResolvers for integrating a JSF web layer with a Spring service layer which is hosted in a Spring root WebApplicationContext.org.springframework.web.servlet Provides servlets that integrate with the application context infrastructure, and the core interfaces and classes for the Spring web MVC framework.org.springframework.web.servlet.support Support classes for Spring's web MVC framework.org.springframework.web.servlet.view.tiles3 Support classes for the integration of Tiles 3 (the standalone version of Tiles) as Spring web view technology.org.springframework.test.web.servlet中WebApplicationContext的使用
参数类型为WebApplicationContext的org.springframework.test.web.servlet中的方法 修饰符和类型 方法 说明 protected MockMvcMockMvcBuilderSupport. createMockMvc(Filter[] filters, MockServletConfig servletConfig, WebApplicationContext webAppContext, RequestBuilder defaultRequestBuilder, List<ResultMatcher> globalResultMatchers, List<ResultHandler> globalResultHandlers, List<DispatcherServletCustomizer> dispatcherServletCustomizers)org.springframework.test.web.servlet.htmlunit中WebApplicationContext的使用
参数类型为WebApplicationContext的org.springframework.test.web.servlet.htmlunit中的方法 修饰符和类型 方法 说明 static MockMvcWebClientBuilderMockMvcWebClientBuilder. webAppContextSetup(WebApplicationContext context)Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContext.static MockMvcWebClientBuilderMockMvcWebClientBuilder. webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer)Create a newMockMvcWebClientBuilderbased on the suppliedWebApplicationContextandMockMvcConfigurer.参数类型为WebApplicationContext的org.springframework.test.web.servlet.htmlunit中的构造器 构造器 说明 MockMvcWebClientBuilder(WebApplicationContext context)MockMvcWebClientBuilder(WebApplicationContext context, MockMvcConfigurer configurer)MockMvcWebConnectionBuilderSupport(WebApplicationContext context)Create a new instance using the suppliedWebApplicationContext.MockMvcWebConnectionBuilderSupport(WebApplicationContext context, MockMvcConfigurer configurer)Create a new instance using the suppliedWebApplicationContextandMockMvcConfigurer.org.springframework.test.web.servlet.htmlunit.webdriver中WebApplicationContext的使用
参数类型为WebApplicationContext的org.springframework.test.web.servlet.htmlunit.webdriver中的方法 修饰符和类型 方法 说明 static MockMvcHtmlUnitDriverBuilderMockMvcHtmlUnitDriverBuilder. webAppContextSetup(WebApplicationContext context)Create a newMockMvcHtmlUnitDriverBuilderbased on the suppliedWebApplicationContext.static MockMvcHtmlUnitDriverBuilderMockMvcHtmlUnitDriverBuilder. webAppContextSetup(WebApplicationContext context, MockMvcConfigurer configurer)Create a newMockMvcHtmlUnitDriverBuilderbased on the suppliedWebApplicationContextandMockMvcConfigurer.参数类型为WebApplicationContext的org.springframework.test.web.servlet.htmlunit.webdriver中的构造器 构造器 说明 MockMvcHtmlUnitDriverBuilder(WebApplicationContext context)MockMvcHtmlUnitDriverBuilder(WebApplicationContext context, MockMvcConfigurer configurer)org.springframework.test.web.servlet.setup中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.test.web.servlet.setup中的方法 修饰符和类型 方法 说明 protected abstract WebApplicationContextAbstractMockMvcBuilder. initWebAppContext()A method to obtain theWebApplicationContextto be passed to theDispatcherServlet.protected WebApplicationContextDefaultMockMvcBuilder. initWebAppContext()protected WebApplicationContextStandaloneMockMvcBuilder. initWebAppContext()参数类型为WebApplicationContext的org.springframework.test.web.servlet.setup中的方法 修饰符和类型 方法 说明 default 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.RequestPostProcessorMockMvcConfigurerAdapter. beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext cxt)RequestPostProcessorSharedHttpSessionConfigurer. beforeMockMvcCreated(ConfigurableMockMvcBuilder<?> builder, WebApplicationContext context)static DefaultMockMvcBuilderMockMvcBuilders. webAppContextSetup(WebApplicationContext context)Build aMockMvcinstance using the given, fully initialized (i.e., refreshed)WebApplicationContext.参数类型为WebApplicationContext的org.springframework.test.web.servlet.setup中的构造器 构造器 说明 DefaultMockMvcBuilder(WebApplicationContext webAppContext)Protected constructor.org.springframework.web.bind.support中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.web.bind.support中的方法 修饰符和类型 方法 说明 protected WebApplicationContextSpringWebConstraintValidatorFactory. getWebApplicationContext()Retrieve the SpringWebApplicationContextto use.org.springframework.web.context中WebApplicationContext的使用
org.springframework.web.context中WebApplicationContext的子接口 修饰符和类型 接口 说明 interfaceConfigurableWebApplicationContextInterface to be implemented by configurable web application contexts.返回WebApplicationContext的org.springframework.web.context中的方法 修饰符和类型 方法 说明 protected abstract WebApplicationContextAbstractContextLoaderInitializer. createRootApplicationContext()Create the "root" application context to be provided to theContextLoaderListener.protected WebApplicationContextContextLoader. createWebApplicationContext(ServletContext sc)Instantiate the root WebApplicationContext for this loader, either the default context class or a custom context class if specified.static WebApplicationContextContextLoader. getCurrentWebApplicationContext()Obtain the Spring root web application context for the current thread (i.e. for the current thread's context ClassLoader, which needs to be the web application's ClassLoader).WebApplicationContextContextLoader. 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.参数类型为WebApplicationContext的org.springframework.web.context中的构造器 构造器 说明 ContextLoader(WebApplicationContext context)Create a newContextLoaderwith the given application context.ContextLoaderListener(WebApplicationContext context)Create a newContextLoaderListenerwith the given application context.org.springframework.web.context.support中WebApplicationContext的使用
实现WebApplicationContext的org.springframework.web.context.support中的类 修饰符和类型 类 说明 classAbstractRefreshableWebApplicationContextAbstractRefreshableApplicationContextsubclass which implements theConfigurableWebApplicationContextinterface for web environments.classAnnotationConfigWebApplicationContextWebApplicationContextimplementation which accepts component classes as input — in particular@Configuration-annotated classes, but also plain@Componentclasses and JSR-330 compliant classes usingjavax.injectannotations.classGenericWebApplicationContextSubclass ofGenericApplicationContext, suitable for web environments.classGroovyWebApplicationContextWebApplicationContextimplementation which takes its configuration from Groovy bean definition scripts and/or XML files, as understood by aGroovyBeanDefinitionReader.classStaticWebApplicationContextStaticWebApplicationContextimplementation for testing.classXmlWebApplicationContextWebApplicationContextimplementation which takes its configuration from XML documents, understood by anXmlBeanDefinitionReader.返回WebApplicationContext的org.springframework.web.context.support中的方法 修饰符和类型 方法 说明 static WebApplicationContextWebApplicationContextUtils. findWebApplicationContext(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(ServletContext sc)Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.WebApplicationContextContextExposingHttpServletRequest. getWebApplicationContext()Return the WebApplicationContext that this request runs in.static WebApplicationContextWebApplicationContextUtils. getWebApplicationContext(ServletContext sc)Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.static WebApplicationContextWebApplicationContextUtils. getWebApplicationContext(ServletContext sc, String attrName)Find a customWebApplicationContextfor this web app.protected WebApplicationContextWebApplicationObjectSupport. getWebApplicationContext()Return the current application context as WebApplicationContext.参数类型为WebApplicationContext的org.springframework.web.context.support中的构造器 构造器 说明 ContextExposingHttpServletRequest(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.org.springframework.web.filter中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.web.filter中的方法 修饰符和类型 方法 说明 protected WebApplicationContextDelegatingFilterProxy. findWebApplicationContext()Return theWebApplicationContextpassed in at construction time, if available.参数类型为WebApplicationContext的org.springframework.web.filter中的方法 修饰符和类型 方法 说明 protected FilterDelegatingFilterProxy. initDelegate(WebApplicationContext wac)Initialize the Filter delegate, defined as bean the given Spring application context.参数类型为WebApplicationContext的org.springframework.web.filter中的构造器 构造器 说明 DelegatingFilterProxy(String targetBeanName, WebApplicationContext wac)Create a newDelegatingFilterProxythat will retrieve the named target bean from the given SpringWebApplicationContext.org.springframework.web.jsf中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.web.jsf中的方法 修饰符和类型 方法 说明 static WebApplicationContextFacesContextUtils. getRequiredWebApplicationContext(FacesContext fc)Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.protected WebApplicationContextDelegatingNavigationHandlerProxy. getWebApplicationContext(FacesContext facesContext)Retrieve the web application context to delegate bean name resolution to.protected WebApplicationContextDelegatingPhaseListenerMulticaster. getWebApplicationContext(FacesContext facesContext)Retrieve the web application context to delegate bean name resolution to.static WebApplicationContextFacesContextUtils. getWebApplicationContext(FacesContext fc)Find the rootWebApplicationContextfor this web app, typically loaded viaContextLoaderListener.org.springframework.web.jsf.el中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.web.jsf.el中的方法 修饰符和类型 方法 说明 protected WebApplicationContextSpringBeanFacesELResolver. getWebApplicationContext(ELContext elContext)Retrieve the web application context to delegate bean name resolution to.protected WebApplicationContextWebApplicationContextFacesELResolver. getWebApplicationContext(ELContext elContext)Retrieve theWebApplicationContextreference to expose.org.springframework.web.servlet中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 protected WebApplicationContextFrameworkServlet. createWebApplicationContext(ApplicationContext parent)Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContextor acustom context class, if set.protected WebApplicationContextFrameworkServlet. createWebApplicationContext(WebApplicationContext parent)Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContextor acustom context class, if set.protected WebApplicationContextFrameworkServlet. findWebApplicationContext()WebApplicationContextFrameworkServlet. getWebApplicationContext()Return this servlet's WebApplicationContext.protected WebApplicationContextFrameworkServlet. initWebApplicationContext()Initialize and publish the WebApplicationContext for this servlet.参数类型为WebApplicationContext的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 protected WebApplicationContextFrameworkServlet. createWebApplicationContext(WebApplicationContext parent)Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContextor acustom context class, if set.参数类型为WebApplicationContext的org.springframework.web.servlet中的构造器 构造器 说明 DispatcherServlet(WebApplicationContext webApplicationContext)Create a newDispatcherServletwith the given web application context.FrameworkServlet(WebApplicationContext webApplicationContext)Create a newFrameworkServletwith the given web application context.org.springframework.web.servlet.support中WebApplicationContext的使用
返回WebApplicationContext的org.springframework.web.servlet.support中的方法 修饰符和类型 方法 说明 protected 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 WebApplicationContextRequestContextUtils. 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 WebApplicationContextRequestContextUtils. 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.WebApplicationContextRequestContext. getWebApplicationContext()Return the current WebApplicationContext.参数类型为WebApplicationContext的org.springframework.web.servlet.support中的方法 修饰符和类型 方法 说明 protected FrameworkServletAbstractDispatcherServletInitializer. createDispatcherServlet(WebApplicationContext servletAppContext)Create aDispatcherServlet(or other kind ofFrameworkServlet-derived dispatcher) with the specifiedWebApplicationContext.org.springframework.web.servlet.view.tiles3中WebApplicationContext的使用
参数类型为WebApplicationContext的org.springframework.web.servlet.view.tiles3中的方法 修饰符和类型 方法 说明 protected abstract ViewPreparerAbstractSpringPreparerFactory. getPreparer(String name, WebApplicationContext context)Obtain a preparer instance for the given preparer name, based on the given Spring WebApplicationContext.protected ViewPreparerSimpleSpringPreparerFactory. getPreparer(String name, WebApplicationContext context)protected ViewPreparerSpringBeanPreparerFactory. getPreparer(String name, WebApplicationContext context)