Struts1 中spring及struts配置文件简析

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"); 控制跳转。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值