Posted on 2009-02-16 20:09
啥都寫點(diǎn) 閱讀(144)
評論(0) 編輯 收藏 所屬分類:
J2EE
1、 把上面的type換成type=”org.springframework.web.struts.DelegatingActionProxy”
2、 并且在struts-config.xml中加入:
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/classes/applicationContext.xml"
/>
</plug-in>
作用是方便spring來管理
3、在applicationContext中加入:
<bean name="/person"
class="org.lxh.struts.action.PersonAction">
<property
name="persondao">
<ref
bean="persondao"/>
</property>
</bean>
第二種實(shí)現(xiàn):
不用改變Action中的type
在struts-config.xml中加入
<controller
processorClass="org.springframework.web.struts.DelegatingRequestProcessor">
</controller>
--
學(xué)海無涯