Struts使用标签的问题

使用html:cancel标签需要注意一些问题,否则配置好以后也会出错。

下面看看解决方案吧:

Any existing applications that use the Cancel processing will need to modify their struts-config.xml to set the cancellable property for actions which require it.

In Struts 1.2.9 the <set-property> is used to set the cancellable property for an action....

    <action path="/fooAction"
input="/foo.jsp"
validate="true">
<set-property property="cancellable" value="true"/>
<forward name="success" path="/bar.jsp"/>
</action>

From Struts 1.3.x a new cancellable attribute can be used....

    <action path="/fooAction"
input="/foo.jsp"
validate="true"
cancellable="true">
<forward name="success" path="/bar.jsp"/>
</action>

In both Struts 1.2.9 and Struts 1.3.x an exception handler can be configured to handle the InvalidCancelException

    <action path="/fooAction"
input="/foo.jsp"
validate="true"
cancellable="true">
<forward name="success" path="/bar.jsp"/>
<exception key="errors.cancel"
type="org.apache.struts.action.InvalidCancelException"
path="/foo.jsp"/>
</action>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值