招聘
java工程师
java jsp servlet spring hibernate js css
上面会一部分既可qq 283765999 
地点:北京

解决方案 »

  1.   

    3. struts-sys-config.xml
    ...
    <action 
    path="/test2"
    type="com.test.action.TestAction"
    scope="request" 
    parameter="method" 
    validate="false">
    <forward name="succeed" path="succeed.jsp" redirect="true"/>
    </action>
    -----------------------------
    上述配置中,type怎么直接取值“com.test.action.TestAction”,怎么不是使用“org.springframework.web.struts.DelegatingActionProxy”代理,当然spring会找不到的。因为这个bean没有交给spring容器去管理啊。
      

  2.   

    谢谢smallbird105(快乐鸟) 的提醒
    更正:
    3. struts-sys-config.xml
    ...
    <action 
    path="/test2"
    type="org.springframework.web.struts.DelegatingActionProxy"
    scope="request" 
    parameter="method" 
    validate="false">
    <forward name="succeed" path="succeed.jsp" redirect="true"/>
    </action>
    其实我的是这样的,只是后来copy过这发贴子的时候copy错了.
      

  3.   

    你Spring的WebApplicationContext是怎么启动的呢?
      

  4.   

    为了在Struts中加载Spring Context,你可能要在struts-config.xml中增加如下部分:
    <struts-config>
    <plug-in
    className="org.springframework.web.struts.ContextLoaderPlugIn">
    <set-property property="contextConfigLocation"
    value="/WEB-INF/applicationContext.xml" />
    </plug-in>
    </struts-config>
    或在其他地方配置spring容器。