spring contextLoaderListener
2016-10-08 11:14:38 0 举报
Spring ContextLoaderListener是一个实现了ServletContextListener接口的类,用于在Web应用程序启动时初始化Spring容器。它通过读取web.xml文件中的配置信息,将Spring配置文件(如applicationContext.xml)加载到内存中,并创建对应的ApplicationContext对象。这样,我们就可以在应用程序中使用Spring框架提供的各种功能,如依赖注入、AOP等。ContextLoaderListener通常与DispatcherServlet一起使用,以实现Spring MVC框架的功能。
作者其他创作
大纲/内容
javax.servlet.ServletContextListener
+ contextInitialized(javax.servlet.ServletContextEvent e);- contextDestroyed(javax.servlet.ServletContextEvent e);
ContextLoaderListener
+ ContextLoader contextLoader
ContextLoader
WebApplicationContext initWebApplicationContext(ServletContext servletContext)
0 条评论
下一页