明天的明天的明天

用键盘改变生活

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  17 Posts :: 0 Stories :: 19 Comments :: 0 Trackbacks
这个问题,本来已经搞好了,但是忘了重新编译,郁闷了半天。。
下面看看解决方案吧:

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>
posted on 2007-10-20 01:20 Endless 阅读(1687) 评论(5)  编辑  收藏

Feedback

# re: 标签报org.apache.struts.action.InvalidCancelException错误问题 2007-10-31 16:11 流浪汗
多谢,我也遇到此问题.  回复  更多评论
  

# re: 标签报org.apache.struts.action.InvalidCancelException错误问题 2008-07-23 10:04 lui
我也遇到了这个问题,用博主的方法试了一下,果然,点击cancel以后不会包异常了,但是, 这时候点击submit和cancel的结果是一样的,这并不是我们想要的结果. 后来干脆 我直接把<html:cancel/>改成了<html:reset/>,结果一切OK了  回复  更多评论
  

# re: 标签报org.apache.struts.action.InvalidCancelException错误问题 2008-08-21 19:01 admin
错误解决了啊 谢谢你啊 啊   回复  更多评论
  

# re: 标签报org.apache.struts.action.InvalidCancelException错误问题 2009-02-23 09:19 GGYY
先谢谢楼主了,三楼的问题我还没有调试,先试一下再说吧,呵呵  回复  更多评论
  

# re: 标签报org.apache.struts.action.InvalidCancelException错误问题[未登录] 2010-07-23 16:04 123
@lui
你没有弄清楚reset和cancel的区别  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: