嘻皮客娱乐学习网

标题: Spring里面applicationContext.xml文件能不能改成其他文件名 [打印本页]

作者: 格外    时间: 2014-11-30 15:52
标题: Spring里面applicationContext.xml文件能不能改成其他文件名
ContextLoaderListener是一个ServletContextListener, 它在你的web应用启动的时候初始化。缺省情况下, 它会在WEB-INF/applicationContext.xml文件找Spring的配置。 你可以通过定义一个元素名字为”contextConfigLocation”来改变Spring配置文件的位置。示例如下:

    org.springframework.web.context.ContextLoaderListener
     
        contextConfigLocation
        /WEB-INF/xyz.xml




欢迎光临 嘻皮客娱乐学习网 (http://www.xipick.com/) Powered by Discuz! X3.3