Spring问题

各位同行好!
请教两个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是如何保证的。

谢谢各位!

注入(IOC)
[该贴被linuxnc于2009-09-09 23:50修改过]
1.是在XML的配置文件中实现了注入的操作。

2,我想你应该是无理解好注入的思想,很多时候先后顺序之所以表面看上去不合理,是因为你无看到注入的内容。