发现没人用spring了,都没人知道吗?

解决方案 »

  1.   

    <ref bean="user"/>你需要在web.xml里面对你要使用到的bean进行一个初始化<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/config/data.xml /WEB-INF/config/service.xml
    </param-value>
    </context-param>
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
      

  2.   

    你有没有在STRUTS有没有把不的ACTION交给SPRING来处理呢\?
    应该是这个原因的
      

  3.   

    1.在struts-config.xml里加Plugin
    <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
    <set-property property="contextConfigLocation" value="classpath:applicationContext*.xml" />
    </plug-in>2.在applicationContext.xml里实例Action如LZ所做
    3.在struts-config.xml里配置Action
    path一定要为spring中实例好的Action的name
    必须要有type="org.springframework.web.struts.DelegatingActionProxy"参考
    http://www-128.ibm.com/developerworks/java/library/j-sr2.html?ca=drs-tp4105