码迷,mamicode.com
首页 > 编程语言 > 详细

spring config detail (持续更新中...)

时间:2015-10-28 15:55:05      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

spring config 的一些实用细节。做个小小的总结,会不断更新......

1.contextConfigLocation

<1>.contextConfigLocation 

在web.xml中定义,通过contextConfigLocation 来配置spring,用来定义要载入的spring 配置文件。

<context-param>
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:applicationContext.xml</param-value>
</context-param>

如果没有指定的话,默认加载/WEB-INF/下的 applicationContext.xml.

如果要配置多个文件,param-value 用 逗号分割。

<2>.ContextLoaderListener

对应 listener 配置

 <listener>   
       <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class >   
  </listener>



spring config detail (持续更新中...)

标签:

原文地址:http://my.oschina.net/pingjiangyetan/blog/523108

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!