请教两个spring的问题
1、spring中的bean实现ServletContextAware接口
public void setServletContext(ServletContext sc){
this.servletContext = sc;
}
在该bean中即可获得servletContext对象。我不明白spring在什么时候给它的?
2、在spring的api 中public interface ApplicationContextAware
setApplicationContext(ApplicationContext applicationContext) 方法
Invoked after population of normal bean properties but before an init callback such as InitializingBean.afterPropertiesSet() or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader), ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and MessageSourceAware, if applicable
这种方法的先后顺序调用,spring是如何保证的。
谢谢各位!