读书人

spring项目中监听器功用-ContextLoade

发布时间: 2012-10-27 10:42:26 作者: rapoo

spring项目中监听器作用-ContextLoaderListener

?

1 spring框架的启动入口 ContextLoaderListener

2 作用:在启动Web容器时,自动装配Spring applicationContext.xml的配置信息。

因为它实现了ServletContextListener这个接口,在web.xml配置这个监听器,启动容器时,就会默认执行它实现的方法。在ContextLoaderListener中关联了ContextLoader这个类,所以整个加载配置过程由ContextLoader来完成

?

</listener>

?

?

读书人网 >编程

热点推荐