Struts1
Spring 配置文件:applicationContext.xml
<bean name="/getCA1FormData" class="com.autelan.flow.struts.action.FormBaseAction" > <property name="flowService"> <ref local="CAFlowService" /> </property> </bean>
name: 与struts配置文件:struts-config.xml 中 action path="/getCA2FormData"向对应
class :配置相对应的Action
property:配置action中的属性
name:对应action中的属性名称
<ref local 是寻找本 xml 文件中的 bean 。(如果是:<ref bean 则是寻找全局中的 bean)
struts配置文件:struts-config.xml
<action-mappings > <action path="/getCA2FormData" parameter="getFormData" type="org.springframework.web.struts.DelegatingActionProxy" > <forward name="success" path="/resultXML.jsp" /> <forward name="emptyFormData" path="/xml/CA2Info.xml" /> <forward name="fail" path="/failXML.jsp" /> </action> </action-mappings >
path:与Spring配置文件bean name 对应 (jsp中的.do)
parameter:action 中方法的名称
forward :action中方法返回值:return mapping.findForward("fail"); 控制跳转。