classpath*:applicationContext-*.xml
只能读取到当前项目中的文件
可jar中文件就是拿不到...
找了两天资料都没发现实用的 真郁闷
大家帮帮忙了

解决方案 »

  1.   

    1.如果你是采用三大框架做的,就可以将
    <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
        <set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml"/>
    </plug-in>
    放入到struts-config.xml中,再不行就把
    包Spring的包全部看看
    2.我建议你重新生成项目
      

  2.   

    我是希望在
             <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext-*.xml</param-value>
    </context-param>
    中 拿到
    我jar包中的applicationContext.xml文件
    问题是这个要怎么写?
      

  3.   

    你把它拿出来,放到classpath里
      

  4.   


    在web.xml文件中 
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:applicationContext-*.xml,/WEB-INF/applicationContext-*.xml</param-value>
      </context-param>
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>struts-config.xml文件中
     <!-- 增加用户信息 -->
        <action path="/regist"
         type="org.springframework.web.struts.DelegatingActionProxy"
         name="userForm"
         parameter="insertUser"
         scope="request"
        >
        <forward name="success" path="/regist.jsp"></forward>
        </action>