您的位置:首页 > 移动开发

J2EE 加载Spring的applicationContext.xml文件的两种方式

2009-08-07 10:17 603 查看
1、在web.xml中加载:

    <context-param>

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

        <param-value>**/applicationContext.xml</param-value>

    </context-param>

 

    <listener>

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

    </listener>

 

2、在struts-config.xml中加载:

    <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">

        <set-property property="contextConfigLocation" value="**/applicationContext.xml" />

    </plug-in>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring