Dorado 7 源码分析(一)SpringContextLoaderListener
2012-12-20 22:43
489 查看
根据Web.xml的加载顺序context-param->listener->filter->servlet 从SpringContextLoaderListener开始
Dorado7的Web服务是依托Spring MVC构建起来的(对Dorado源码分析将同时对Spring也进一步讲解)
Dorado7的Web服务是依托Spring MVC构建起来的(对Dorado源码分析将同时对Spring也进一步讲解)
public class SpringContextLoaderListener extends ContextLoaderListener { // Dorado 日志是基于apache.commons.logging管理的 至于后面配置log4j是由apache.commons.logging转向log4j private static final Log logger = LogFactory .getLog(SpringContextLoaderListener.class); /**DoradoLoader是一个单例 *主要是服务启动时读取Dorado 配置文件, *处理Spring的配置文件 *创建临时的ResourceLoader *创建临时存储目录 *初始化WebContext等等 *详细在后续DoradoLoader章节讲解 */ private DoradoLoader doradoLoader; public SpringContextLoaderListener() { doradoLoader = DoradoLoader.getInstance(); } @Override protected void customizeContext(ServletContext servletContext, ConfigurableWebApplicationContext applicationContext) { try { doradoLoader.preload(servletContext, true); List<String> doradoContextLocations = doradoLoader .getContextLocations(false); String[] realResourcesPath = doradoLoader .getRealResourcesPath(doradoContextLocations); applicationContext.setConfigLocations(realResourcesPath); } catch (Exception e) { logger.error(e, e); } } }
相关文章推荐
- 【spring】源码分析 <一> 从ContextLoaderListener开始·
- Spring IOC学习心得之源码级分析ContextLoaderListener的作用(IOC容器初始化入口)
- Spring源码之ContextLoaderListener(3)
- Springmvc ContextLoaderListener监听器功能分析
- springMVC源码分析--容器初始化(一)ContextLoaderListener
- Spring源码情操陶冶-ContextLoaderListener
- 共同学习Spring源码--ContextLoaderListener和ContextCleanupListener
- Spring源码跟踪之ContextLoaderListener
- springMVC源码分析--容器初始化(一)ContextLoaderListener
- springMVC源码分析--容器初始化(一)ContextLoaderListener
- Spring源码学习(二)ContextLoaderListener
- springMVC源码分析--容器初始化(一)ContextLoaderListener
- Spring-web源码解析之ContextLoaderListener
- Spring源码分析之RequestContextListener
- Spring源码之ContextLoaderListener(1)
- 小读spring ioc源码(二)——ContextLoaderListener
- Spring源码学习之一 ContextLoaderListener及XmlWebApplicationContext
- Spring源码之ContextLoaderListener(2)
- java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Error configuring application listener of class org.springframework.web.context.ContextLoaderListener