接口的使用
org.springframework.context.ApplicationContext
使用ApplicationContext的程序包 程序包 说明 org.springframework.context This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.org.springframework.context.annotation Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.org.springframework.context.event Support classes for application events, like standard context events.org.springframework.context.support Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.org.springframework.http.converter.json Provides HttpMessageConverter implementations for handling JSON.org.springframework.jca.context Integration package that allows for deploying a Spring application context as a JCA 1.7 compliant RAR file.org.springframework.jms.config Support package for declarative messaging configuration, with Java configuration and XML schema support.org.springframework.messaging.handler.invocation Common infrastructure for invoking message handler methods.org.springframework.messaging.handler.invocation.reactive Common infrastructure for invoking message handler methods with non-blocking, and reactive contracts.org.springframework.messaging.simp.config Configuration support for WebSocket messaging using higher level messaging protocols.org.springframework.scheduling.annotation Java 5 annotation for asynchronous method execution.org.springframework.scheduling.quartz Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context.org.springframework.test.context This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.org.springframework.test.context.cache Support for context caching within the Spring TestContext Framework.org.springframework.test.context.junit.jupiter Core support for integrating the Spring TestContext Framework with the JUnit Jupiter extension model in JUnit 5.org.springframework.test.context.junit4 Support classes for integrating the Spring TestContext Framework with JUnit 4.12 or higher.org.springframework.test.context.support Support classes for the Spring TestContext Framework.org.springframework.test.context.testng Support classes for integrating the Spring TestContext Framework with TestNG.org.springframework.test.context.web Web support classes for the Spring TestContext Framework.org.springframework.test.web.reactive.server Support for testing Spring WebFlux server endpoints viaWebTestClient
.org.springframework.ui.context.support Classes supporting the org.springframework.ui.context package.org.springframework.validation.beanvalidation Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.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.context
package, such as WebApplicationContext implementations and various utility classes.org.springframework.web.method Common infrastructure for handler method processing, as used by Spring MVC'sorg.springframework.web.servlet.mvc.method
package.org.springframework.web.reactive Top-level package for thespring-webflux
module that containsDispatcherHandler
, the main entry point for WebFlux server endpoint processing including key contracts used to map requests to handlers, invoke them, and process the result.org.springframework.web.reactive.config Spring WebFlux configuration infrastructure.org.springframework.web.reactive.result.method.annotation Infrastructure for annotation-based handler method processing.org.springframework.web.reactive.result.view Support for result handling through view resolution.org.springframework.web.reactive.result.view.script Support classes for views based on the JSR-223 script engine abstraction (as included in Java 6+), e.g. using JavaScript via Nashorn on JDK 8.org.springframework.web.server Core interfaces and classes for Spring's generic, reactive web support.org.springframework.web.server.adapter Implementations to adapt to the underlyingorg.springframework.http.client.reactive
reactive HTTP adapter andHttpHandler
.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.config.annotation Annotation-based setup for Spring MVC.org.springframework.web.servlet.handler Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.org.springframework.web.servlet.mvc.method.annotation MVC infrastructure for annotation-based handler method processing, building on theorg.springframework.web.method.annotation
package.org.springframework.web.servlet.resource Support classes for serving static resources.org.springframework.web.servlet.view Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.org.springframework.web.servlet.view.groovy Support classes for the integration of Groovy Templates as Spring web view technology.org.springframework.web.servlet.view.script Support classes for views based on the JSR-223 script engine abstraction (as included in Java 6+), e.g. using JavaScript via Nashorn on JDK 8.org.springframework.web.socket.adapter.standard Adapter classes for the standard Java WebSocket API.org.springframework.web.socket.config.annotation Support for annotation-based WebSocket setup in configuration classes.org.springframework.context中ApplicationContext的使用
org.springframework.context中ApplicationContext的子接口 修饰符和类型 接口 说明 interface
ConfigurableApplicationContext
SPI interface to be implemented by most if not all application contexts.返回ApplicationContext的org.springframework.context中的方法 修饰符和类型 方法 说明 ApplicationContext
ApplicationContext. getParent()
Return the parent context, ornull
if there is no parent and this is the root of the context hierarchy.参数类型为ApplicationContext的org.springframework.context中的方法 修饰符和类型 方法 说明 void
ApplicationContextAware. setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in.void
ConfigurableApplicationContext. setParent(ApplicationContext parent)
Set the parent of this application context.org.springframework.context.annotation中ApplicationContext的使用
实现ApplicationContext的org.springframework.context.annotation中的类 修饰符和类型 类 说明 class
AnnotationConfigApplicationContext
Standalone application context, accepting component classes as input — in particular@Configuration
-annotated classes, but also plain@Component
types and JSR-330 compliant classes usingjavax.inject
annotations.org.springframework.context.event中ApplicationContext的使用
返回ApplicationContext的org.springframework.context.event中的方法 修饰符和类型 方法 说明 ApplicationContext
ApplicationContextEvent. getApplicationContext()
Get theApplicationContext
that the event was raised for.参数类型为ApplicationContext的org.springframework.context.event中的方法 修饰符和类型 方法 说明 void
EventListenerMethodProcessor. setApplicationContext(ApplicationContext applicationContext)
参数类型为ApplicationContext的org.springframework.context.event中的构造器 构造器 说明 ApplicationContextEvent(ApplicationContext source)
Create a new ContextStartedEvent.ContextClosedEvent(ApplicationContext source)
Creates a new ContextClosedEvent.ContextRefreshedEvent(ApplicationContext source)
Create a new ContextRefreshedEvent.ContextStartedEvent(ApplicationContext source)
Create a new ContextStartedEvent.ContextStoppedEvent(ApplicationContext source)
Create a new ContextStoppedEvent.org.springframework.context.support中ApplicationContext的使用
实现ApplicationContext的org.springframework.context.support中的类 修饰符和类型 类 说明 class
AbstractApplicationContext
Abstract implementation of theApplicationContext
interface.class
AbstractRefreshableApplicationContext
Base class forApplicationContext
implementations which are supposed to support multiple calls toAbstractApplicationContext.refresh()
, creating a new internal bean factory instance every time.class
AbstractRefreshableConfigApplicationContext
AbstractRefreshableApplicationContext
subclass that adds common handling of specified config locations.class
AbstractXmlApplicationContext
Convenient base class forApplicationContext
implementations, drawing configuration from XML documents containing bean definitions understood by anXmlBeanDefinitionReader
.class
ClassPathXmlApplicationContext
Standalone XML application context, taking the context definition files from the class path, interpreting plain paths as class path resource names that include the package path (e.g.class
FileSystemXmlApplicationContext
Standalone XML application context, taking the context definition files from the file system or from URLs, interpreting plain paths as relative file system locations (e.g.class
GenericApplicationContext
Generic ApplicationContext implementation that holds a single internalDefaultListableBeanFactory
instance and does not assume a specific bean definition format.class
GenericGroovyApplicationContext
AnApplicationContext
implementation that extendsGenericApplicationContext
and implementsGroovyObject
such that beans can be retrieved with the dot de-reference syntax instead of usingAbstractApplicationContext.getBean(java.lang.String)
.class
GenericXmlApplicationContext
Convenient application context with built-in XML support.class
StaticApplicationContext
ApplicationContext
implementation which supports programmatic registration of beans and messages, rather than reading bean definitions from external configuration sources.返回ApplicationContext的org.springframework.context.support中的方法 修饰符和类型 方法 说明 ApplicationContext
ApplicationObjectSupport. getApplicationContext()
Return the ApplicationContext that this object is associated with.ApplicationContext
AbstractApplicationContext. getParent()
Return the parent context, ornull
if there is no parent (that is, this context is the root of the context hierarchy).protected ApplicationContext
ApplicationObjectSupport. obtainApplicationContext()
Obtain the ApplicationContext for actual use.参数类型为ApplicationContext的org.springframework.context.support中的方法 修饰符和类型 方法 说明 protected void
ApplicationObjectSupport. initApplicationContext(ApplicationContext context)
Subclasses can override this for custom initialization behavior.void
ApplicationObjectSupport. setApplicationContext(ApplicationContext context)
void
LiveBeansView. setApplicationContext(ApplicationContext applicationContext)
void
AbstractApplicationContext. setParent(ApplicationContext parent)
Set the parent of this application context.void
GenericApplicationContext. setParent(ApplicationContext parent)
Set the parent of this application context, also setting the parent of the internal BeanFactory accordingly.参数类型为ApplicationContext的org.springframework.context.support中的构造器 构造器 说明 AbstractApplicationContext(ApplicationContext parent)
Create a new AbstractApplicationContext with the given parent context.AbstractRefreshableApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableApplicationContext with the given parent context.AbstractRefreshableConfigApplicationContext(ApplicationContext parent)
Create a new AbstractRefreshableConfigApplicationContext with the given parent context.AbstractXmlApplicationContext(ApplicationContext parent)
Create a new AbstractXmlApplicationContext with the given parent context.ClassPathXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files.ClassPathXmlApplicationContext(String[] paths, Class<?> clazz, ApplicationContext parent)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.ClassPathXmlApplicationContext(String[] configLocations, ApplicationContext parent)
Create a new ClassPathXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.ClassPathXmlApplicationContext(ApplicationContext parent)
Create a new ClassPathXmlApplicationContext for bean-style configuration.FileSystemXmlApplicationContext(String[] configLocations, boolean refresh, ApplicationContext parent)
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files.FileSystemXmlApplicationContext(String[] configLocations, ApplicationContext parent)
Create a new FileSystemXmlApplicationContext with the given parent, loading the definitions from the given XML files and automatically refreshing the context.FileSystemXmlApplicationContext(ApplicationContext parent)
Create a new FileSystemXmlApplicationContext for bean-style configuration.GenericApplicationContext(DefaultListableBeanFactory beanFactory, ApplicationContext parent)
Create a new GenericApplicationContext with the given DefaultListableBeanFactory.GenericApplicationContext(ApplicationContext parent)
Create a new GenericApplicationContext with the given parent.StaticApplicationContext(ApplicationContext parent)
Create a new StaticApplicationContext with the given parent.org.springframework.http.converter.json中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.http.converter.json中的方法 修饰符和类型 方法 说明 Jackson2ObjectMapperBuilder
Jackson2ObjectMapperBuilder. applicationContext(ApplicationContext applicationContext)
Set the SpringApplicationContext
in order to autowire Jackson handlers (JsonSerializer
,JsonDeserializer
,KeyDeserializer
,TypeResolverBuilder
andTypeIdResolver
).void
Jackson2ObjectMapperFactoryBean. setApplicationContext(ApplicationContext applicationContext)
Set the builderApplicationContext
in order to autowire Jackson handlers (JsonSerializer
,JsonDeserializer
,KeyDeserializer
,TypeResolverBuilder
andTypeIdResolver
).org.springframework.jca.context中ApplicationContext的使用
实现ApplicationContext的org.springframework.jca.context中的类 修饰符和类型 类 说明 class
ResourceAdapterApplicationContext
ApplicationContext
implementation for a JCA ResourceAdapter.org.springframework.jms.config中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.jms.config中的方法 修饰符和类型 方法 说明 void
JmsListenerEndpointRegistry. setApplicationContext(ApplicationContext applicationContext)
org.springframework.messaging.handler.invocation中ApplicationContext的使用
返回ApplicationContext的org.springframework.messaging.handler.invocation中的方法 修饰符和类型 方法 说明 ApplicationContext
AbstractMethodMessageHandler. getApplicationContext()
参数类型为ApplicationContext的org.springframework.messaging.handler.invocation中的方法 修饰符和类型 方法 说明 void
AbstractMethodMessageHandler. setApplicationContext(ApplicationContext applicationContext)
org.springframework.messaging.handler.invocation.reactive中ApplicationContext的使用
返回ApplicationContext的org.springframework.messaging.handler.invocation.reactive中的方法 修饰符和类型 方法 说明 ApplicationContext
AbstractMethodMessageHandler. getApplicationContext()
参数类型为ApplicationContext的org.springframework.messaging.handler.invocation.reactive中的方法 修饰符和类型 方法 说明 void
AbstractMethodMessageHandler. setApplicationContext(ApplicationContext applicationContext)
org.springframework.messaging.simp.config中ApplicationContext的使用
返回ApplicationContext的org.springframework.messaging.simp.config中的方法 修饰符和类型 方法 说明 ApplicationContext
AbstractMessageBrokerConfiguration. getApplicationContext()
参数类型为ApplicationContext的org.springframework.messaging.simp.config中的方法 修饰符和类型 方法 说明 void
AbstractMessageBrokerConfiguration. setApplicationContext(ApplicationContext applicationContext)
org.springframework.scheduling.annotation中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.scheduling.annotation中的方法 修饰符和类型 方法 说明 void
ScheduledAnnotationBeanPostProcessor. setApplicationContext(ApplicationContext applicationContext)
Setting anApplicationContext
is optional: If set, registered tasks will be activated in theContextRefreshedEvent
phase; if not set, it will happen atScheduledAnnotationBeanPostProcessor.afterSingletonsInstantiated()
time.org.springframework.scheduling.quartz中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.scheduling.quartz中的方法 修饰符和类型 方法 说明 void
JobDetailFactoryBean. setApplicationContext(ApplicationContext applicationContext)
void
SchedulerFactoryBean. setApplicationContext(ApplicationContext applicationContext)
void
SpringBeanJobFactory. setApplicationContext(ApplicationContext applicationContext)
org.springframework.test.context中ApplicationContext的使用
返回ApplicationContext的org.springframework.test.context中的方法 修饰符和类型 方法 说明 ApplicationContext
TestContext. getApplicationContext()
Get the application context for this test context, possibly cached.ApplicationContext
MergedContextConfiguration. getParentApplicationContext()
Get the parentApplicationContext
for the context defined by thisMergedContextConfiguration
from the context cache.ApplicationContext
CacheAwareContextLoaderDelegate. loadContext(MergedContextConfiguration mergedContextConfiguration)
Load the application context for the suppliedMergedContextConfiguration
by delegating to theContextLoader
configured in the givenMergedContextConfiguration
.ApplicationContext
ContextLoader. loadContext(String... locations)
Loads a newcontext
based on the suppliedlocations
, configures the context, and finally returns the context in fully refreshed state.ApplicationContext
SmartContextLoader. loadContext(MergedContextConfiguration mergedConfig)
Loads a newcontext
based on the suppliedmerged context configuration
, configures the context, and finally returns the context in a fully refreshed state.org.springframework.test.context.cache中ApplicationContext的使用
返回ApplicationContext的org.springframework.test.context.cache中的方法 修饰符和类型 方法 说明 ApplicationContext
ContextCache. get(MergedContextConfiguration key)
Obtain a cachedApplicationContext
for the given key.ApplicationContext
DefaultContextCache. get(MergedContextConfiguration key)
Obtain a cachedApplicationContext
for the given key.ApplicationContext
DefaultCacheAwareContextLoaderDelegate. loadContext(MergedContextConfiguration mergedContextConfiguration)
protected ApplicationContext
DefaultCacheAwareContextLoaderDelegate. loadContextInternal(MergedContextConfiguration mergedContextConfiguration)
Load theApplicationContext
for the supplied merged context configuration.参数类型为ApplicationContext的org.springframework.test.context.cache中的方法 修饰符和类型 方法 说明 void
ContextCache. put(MergedContextConfiguration key, ApplicationContext context)
Explicitly add anApplicationContext
instance to the cache under the given key, potentially honoring a custom eviction policy.void
DefaultContextCache. put(MergedContextConfiguration key, ApplicationContext context)
Explicitly add anApplicationContext
instance to the cache under the given key, potentially honoring a custom eviction policy.org.springframework.test.context.junit.jupiter中ApplicationContext的使用
返回ApplicationContext的org.springframework.test.context.junit.jupiter中的方法 修饰符和类型 方法 说明 static ApplicationContext
SpringExtension. getApplicationContext(ExtensionContext context)
Get theApplicationContext
associated with the suppliedExtensionContext
.org.springframework.test.context.junit4中ApplicationContext的使用
声明为ApplicationContext的org.springframework.test.context.junit4中的字段 修饰符和类型 字段 说明 protected ApplicationContext
AbstractJUnit4SpringContextTests. applicationContext
TheApplicationContext
that was injected into this test instance viaAbstractJUnit4SpringContextTests.setApplicationContext(ApplicationContext)
.参数类型为ApplicationContext的org.springframework.test.context.junit4中的方法 修饰符和类型 方法 说明 void
AbstractJUnit4SpringContextTests. setApplicationContext(ApplicationContext applicationContext)
Set theApplicationContext
to be used by this test instance, provided viaApplicationContextAware
semantics.org.springframework.test.context.support中ApplicationContext的使用
返回ApplicationContext的org.springframework.test.context.support中的方法 修饰符和类型 方法 说明 ApplicationContext
DefaultTestContext. getApplicationContext()
Get the application context for this test context.ApplicationContext
AbstractDelegatingSmartContextLoader. loadContext(String... locations)
AbstractDelegatingSmartContextLoader
does not support theContextLoader.loadContext(String...)
method.ApplicationContext
AbstractDelegatingSmartContextLoader. loadContext(MergedContextConfiguration mergedConfig)
Delegates to an appropriate candidateSmartContextLoader
to load anApplicationContext
.org.springframework.test.context.testng中ApplicationContext的使用
声明为ApplicationContext的org.springframework.test.context.testng中的字段 修饰符和类型 字段 说明 protected ApplicationContext
AbstractTestNGSpringContextTests. applicationContext
TheApplicationContext
that was injected into this test instance viaAbstractTestNGSpringContextTests.setApplicationContext(ApplicationContext)
.参数类型为ApplicationContext的org.springframework.test.context.testng中的方法 修饰符和类型 方法 说明 void
AbstractTestNGSpringContextTests. setApplicationContext(ApplicationContext applicationContext)
Set theApplicationContext
to be used by this test instance, provided viaApplicationContextAware
semantics.org.springframework.test.context.web中ApplicationContext的使用
返回ApplicationContext的org.springframework.test.context.web中的方法 修饰符和类型 方法 说明 ApplicationContext
AbstractGenericWebContextLoader. loadContext(String... locations)
AbstractGenericWebContextLoader
should be used as aSmartContextLoader
, not as a legacyContextLoader
.org.springframework.test.web.reactive.server中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.test.web.reactive.server中的方法 修饰符和类型 方法 说明 static WebTestClient.MockServerSpec<?>
WebTestClient. bindToApplicationContext(ApplicationContext applicationContext)
Use this option to setup a server from the Spring configuration of your application, or some subset of it.org.springframework.ui.context.support中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.ui.context.support中的方法 修饰符和类型 方法 说明 static ThemeSource
UiApplicationContextUtils. initThemeSource(ApplicationContext context)
Initialize the ThemeSource for the given application context, autodetecting a bean with the name "themeSource".org.springframework.validation.beanvalidation中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.validation.beanvalidation中的方法 修饰符和类型 方法 说明 void
LocalValidatorFactoryBean. setApplicationContext(ApplicationContext applicationContext)
org.springframework.web.context中ApplicationContext的使用
org.springframework.web.context中ApplicationContext的子接口 修饰符和类型 接口 说明 interface
ConfigurableWebApplicationContext
Interface to be implemented by configurable web application contexts.interface
WebApplicationContext
Interface to provide configuration for a web application.返回ApplicationContext的org.springframework.web.context中的方法 修饰符和类型 方法 说明 protected ApplicationContext
ContextLoader. loadParentContext(ServletContext servletContext)
Template method with default implementation (which may be overridden by a subclass), to load or obtain an ApplicationContext instance which will be used as the parent context of the root WebApplicationContext.org.springframework.web.context.support中ApplicationContext的使用
实现ApplicationContext的org.springframework.web.context.support中的类 修饰符和类型 类 说明 class
AbstractRefreshableWebApplicationContext
AbstractRefreshableApplicationContext
subclass which implements theConfigurableWebApplicationContext
interface for web environments.class
AnnotationConfigWebApplicationContext
WebApplicationContext
implementation which accepts component classes as input — in particular@Configuration
-annotated classes, but also plain@Component
classes and JSR-330 compliant classes usingjavax.inject
annotations.class
GenericWebApplicationContext
Subclass ofGenericApplicationContext
, suitable for web environments.class
GroovyWebApplicationContext
WebApplicationContext
implementation which takes its configuration from Groovy bean definition scripts and/or XML files, as understood by aGroovyBeanDefinitionReader
.class
StaticWebApplicationContext
StaticWebApplicationContext
implementation for testing.class
XmlWebApplicationContext
WebApplicationContext
implementation which takes its configuration from XML documents, understood by anXmlBeanDefinitionReader
.参数类型为ApplicationContext的org.springframework.web.context.support中的方法 修饰符和类型 方法 说明 protected void
WebApplicationObjectSupport. initApplicationContext(ApplicationContext context)
CallsWebApplicationObjectSupport.initServletContext(javax.servlet.ServletContext)
if the given ApplicationContext is aWebApplicationContext
.org.springframework.web.method中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.method中的方法 修饰符和类型 方法 说明 static List<ControllerAdviceBean>
ControllerAdviceBean. findAnnotatedBeans(ApplicationContext context)
Find beans annotated with@ControllerAdvice
in the givenApplicationContext
and wrap them asControllerAdviceBean
instances.org.springframework.web.reactive中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.reactive中的方法 修饰符和类型 方法 说明 protected void
DispatcherHandler. initStrategies(ApplicationContext context)
void
DispatcherHandler. setApplicationContext(ApplicationContext applicationContext)
参数类型为ApplicationContext的org.springframework.web.reactive中的构造器 构造器 说明 DispatcherHandler(ApplicationContext applicationContext)
Create a newDispatcherHandler
for the givenApplicationContext
.org.springframework.web.reactive.config中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.reactive.config中的方法 修饰符和类型 方法 说明 ApplicationContext
WebFluxConfigurationSupport. getApplicationContext()
参数类型为ApplicationContext的org.springframework.web.reactive.config中的方法 修饰符和类型 方法 说明 void
WebFluxConfigurationSupport. setApplicationContext(ApplicationContext applicationContext)
参数类型为ApplicationContext的org.springframework.web.reactive.config中的构造器 构造器 说明 ViewResolverRegistry(ApplicationContext applicationContext)
org.springframework.web.reactive.result.method.annotation中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.reactive.result.method.annotation中的方法 修饰符和类型 方法 说明 void
RequestMappingHandlerAdapter. setApplicationContext(ApplicationContext applicationContext)
AConfigurableApplicationContext
is expected for resolving expressions in method argument default values as well as for detecting@ControllerAdvice
beans.org.springframework.web.reactive.result.view中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.reactive.result.view中的方法 修饰符和类型 方法 说明 ApplicationContext
AbstractView. getApplicationContext()
ApplicationContext
UrlBasedViewResolver. getApplicationContext()
Return the containingApplicationContext
, if any.protected ApplicationContext
AbstractView. obtainApplicationContext()
Obtain theApplicationContext
for actual use.参数类型为ApplicationContext的org.springframework.web.reactive.result.view中的方法 修饰符和类型 方法 说明 void
AbstractView. setApplicationContext(ApplicationContext applicationContext)
void
UrlBasedViewResolver. setApplicationContext(ApplicationContext applicationContext)
Accept the containingApplicationContext
, if any.org.springframework.web.reactive.result.view.script中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.reactive.result.view.script中的方法 修饰符和类型 方法 说明 ApplicationContext
RenderingContext. getApplicationContext()
Return the application context.参数类型为ApplicationContext的org.springframework.web.reactive.result.view.script中的方法 修饰符和类型 方法 说明 void
ScriptTemplateView. setApplicationContext(ApplicationContext context)
参数类型为ApplicationContext的org.springframework.web.reactive.result.view.script中的构造器 构造器 说明 RenderingContext(ApplicationContext applicationContext, Locale locale, Function<String,String> templateLoader, String url)
Create a newRenderingContext
.org.springframework.web.server中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.server中的方法 修饰符和类型 方法 说明 ApplicationContext
ServerWebExchange. getApplicationContext()
Return theApplicationContext
associated with the web application, if it was initialized with one viaWebHttpHandlerBuilder.applicationContext(ApplicationContext)
.ApplicationContext
ServerWebExchangeDecorator. getApplicationContext()
org.springframework.web.server.adapter中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.server.adapter中的方法 修饰符和类型 方法 说明 protected ApplicationContext
AbstractReactiveWebInitializer. createApplicationContext()
Return the Spring configuration that contains application beans including the ones detected byWebHttpHandlerBuilder.applicationContext
.ApplicationContext
DefaultServerWebExchange. getApplicationContext()
ApplicationContext
HttpWebHandlerAdapter. getApplicationContext()
Return the configuredApplicationContext
, if any.参数类型为ApplicationContext的org.springframework.web.server.adapter中的方法 修饰符和类型 方法 说明 static WebHttpHandlerBuilder
WebHttpHandlerBuilder. applicationContext(ApplicationContext context)
Static factory method to create a new builder instance by detecting beans in anApplicationContext
.protected void
AbstractReactiveWebInitializer. refreshApplicationContext(ApplicationContext context)
Refresh the given application context, if necessary.protected void
AbstractReactiveWebInitializer. registerCloseListener(ServletContext servletContext, ApplicationContext applicationContext)
Register aServletContextListener
that closes the given application context when the servlet context is destroyed.void
HttpWebHandlerAdapter. setApplicationContext(ApplicationContext applicationContext)
Configure theApplicationContext
associated with the web application, if it was initialized with one viaWebHttpHandlerBuilder.applicationContext(ApplicationContext)
.org.springframework.web.servlet中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.servlet中的方法 修饰符和类型 方法 说明 protected Object
DispatcherServlet. createDefaultStrategy(ApplicationContext context, Class<?> clazz)
Create a default strategy.protected WebApplicationContext
FrameworkServlet. createWebApplicationContext(ApplicationContext parent)
Instantiate the WebApplicationContext for this servlet, either a defaultXmlWebApplicationContext
or acustom context class
, if set.protected <T> List<T>
DispatcherServlet. getDefaultStrategies(ApplicationContext context, Class<T> strategyInterface)
Create a List of default strategy objects for the given strategy interface.protected <T> T
DispatcherServlet. getDefaultStrategy(ApplicationContext context, Class<T> strategyInterface)
Return the default strategy object for the given strategy interface.protected void
DispatcherServlet. initStrategies(ApplicationContext context)
Initialize the strategy objects that this servlet uses.protected void
DispatcherServlet. onRefresh(ApplicationContext context)
This implementation callsDispatcherServlet.initStrategies(org.springframework.context.ApplicationContext)
.protected void
FrameworkServlet. onRefresh(ApplicationContext context)
Template method which can be overridden to add servlet-specific refresh work.void
FrameworkServlet. setApplicationContext(ApplicationContext applicationContext)
Called by Spring viaApplicationContextAware
to inject the current application context.org.springframework.web.servlet.config.annotation中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 ApplicationContext
WebMvcConfigurationSupport. getApplicationContext()
Return the associated SpringApplicationContext
.参数类型为ApplicationContext的org.springframework.web.servlet.config.annotation中的方法 修饰符和类型 方法 说明 protected void
RedirectViewControllerRegistration. setApplicationContext(ApplicationContext applicationContext)
protected void
ViewControllerRegistration. setApplicationContext(ApplicationContext applicationContext)
void
WebMvcConfigurationSupport. setApplicationContext(ApplicationContext applicationContext)
Set the SpringApplicationContext
, e.g. for resource loading.org.springframework.web.servlet.handler中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.servlet.handler中的方法 修饰符和类型 方法 说明 void
HandlerMappingIntrospector. setApplicationContext(ApplicationContext applicationContext)
参数类型为ApplicationContext的org.springframework.web.servlet.handler中的构造器 构造器 说明 HandlerMappingIntrospector(ApplicationContext context)
已过时。as of 4.3.12, in favor ofHandlerMappingIntrospector.setApplicationContext(org.springframework.context.ApplicationContext)
org.springframework.web.servlet.mvc.method.annotation中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.servlet.mvc.method.annotation中的方法 修饰符和类型 方法 说明 ApplicationContext
ExceptionHandlerExceptionResolver. getApplicationContext()
参数类型为ApplicationContext的org.springframework.web.servlet.mvc.method.annotation中的方法 修饰符和类型 方法 说明 void
ExceptionHandlerExceptionResolver. setApplicationContext(ApplicationContext applicationContext)
org.springframework.web.servlet.resource中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.servlet.resource中的方法 修饰符和类型 方法 说明 protected void
ResourceUrlProvider. detectResourceHandlers(ApplicationContext appContext)
org.springframework.web.servlet.view中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.servlet.view中的方法 修饰符和类型 方法 说明 void
ViewResolverComposite. setApplicationContext(ApplicationContext applicationContext)
org.springframework.web.servlet.view.groovy中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.servlet.view.groovy中的方法 修饰符和类型 方法 说明 protected ApplicationContext
GroovyMarkupConfigurer. getApplicationContext()
参数类型为ApplicationContext的org.springframework.web.servlet.view.groovy中的方法 修饰符和类型 方法 说明 protected void
GroovyMarkupView. initApplicationContext(ApplicationContext context)
Invoked at startup.void
GroovyMarkupConfigurer. setApplicationContext(ApplicationContext applicationContext)
org.springframework.web.servlet.view.script中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.servlet.view.script中的方法 修饰符和类型 方法 说明 ApplicationContext
RenderingContext. getApplicationContext()
Return the application context.参数类型为ApplicationContext的org.springframework.web.servlet.view.script中的方法 修饰符和类型 方法 说明 protected void
ScriptTemplateView. initApplicationContext(ApplicationContext context)
参数类型为ApplicationContext的org.springframework.web.servlet.view.script中的构造器 构造器 说明 RenderingContext(ApplicationContext applicationContext, Locale locale, Function<String,String> templateLoader, String url)
Create a newRenderingContext
.org.springframework.web.socket.adapter.standard中ApplicationContext的使用
返回ApplicationContext的org.springframework.web.socket.adapter.standard中的方法 修饰符和类型 方法 说明 protected ApplicationContext
ConvertingEncoderDecoderSupport. getApplicationContext()
Returns the activeApplicationContext
.org.springframework.web.socket.config.annotation中ApplicationContext的使用
参数类型为ApplicationContext的org.springframework.web.socket.config.annotation中的方法 修饰符和类型 方法 说明 protected void
WebMvcStompEndpointRegistry. setApplicationContext(ApplicationContext applicationContext)