首页 > 编程语言 > 详细

web.xml中的contextConfigLocation在spring中的作用

时间:2016-12-21 11:50:27      阅读:231      评论:0      收藏:0      [点我收藏+]

在web.xml中通过contextConfigLocation配置spring,

contextConfigLocation参数定义了要装入的 Spring 配置文件。

如果想装入多个配置文件,可以在 <param-value>标记中用逗号作分隔符或通配符。

 

在web.xml里配置Listener

web.xml 代码如下:  

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring/app-*.xml</param-value>
</context-param>

app-context.xml

<context:component-scan base-package="com.xdt.ibs" />

 

web.xml中的contextConfigLocation在spring中的作用

原文:http://www.cnblogs.com/ClassNotFoundException/p/6207024.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!