现在的位置: 首页 > 综合 > 正文

如何设定spring配置文件的位置

2013年05月27日 ⁄ 综合 ⁄ 共 428字 ⁄ 字号 评论关闭

在web.xml中的<web-app>节点下定义

 

 

<context-param>

    <param-name>contextConfigLocation</param-name>

    <param-value>/WEB-INF/applicationContext-hibernate.xml</param-value>  

</context-param>

 

<servlet>

    <servlet-name>SpringContextServlet</servlet-name>

    <servlet-class>

       org.springframework.web.context.ContextLoaderServlet

    </servlet-class>   

    <load-on-startup>1</load-on-startup>

</servlet>


 <param-value>表明了spring配置文件的位置

 其它的保持原样就可以了

抱歉!评论已关闭.