org.apache.struts.action.InvalidCancelException异常解决方法
2016-07-13 16:41
549 查看
页面报org.apache.struts.action.InvalidCancelException错误。上网查了一下,说是由于用了validate="true",而导致的异常。解决方案是在struts-config.xml文件中对应action下面添加一个属性cancellable="true"
---------------------------------引用--------------------------------------
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 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 nd 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>
收藏于 2010-07-27
---------------------------------引用--------------------------------------
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 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 nd 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>
收藏于 2010-07-27
相关文章推荐
- JQuery+Strusts1.x无刷新登录
- Ruby中的异常处理代码编写示例
- SQL Server 2005 中使用 Try Catch 处理异常
- MySQL抛出Incorrect string value异常分析
- 浅谈C#中简单的异常引发与处理操作
- 详解C#编程中异常的创建和引发以及异常处理
- 详解JavaScript中的异常处理方法
- java程序中的延时加载异常及解决方案
- 解析Java异常的栈轨迹及其相关方法
- java struts常见错误以及原因分析
- .NET(C#):Emit创建异常处理的方法
- windows7服务器上weblogic启动失败异常解决方法
- 有关ajax的error与后台的异常问题解决
- Struts之logic标签库详解
- 深入探讨JAVA中的异常与错误处理
- GO语言异常处理机制panic和recover分析
- 通过实例深入学习Java的Struts框架中的OGNL表达式使用
- 浅谈JAVA 异常对于性能的影响
- 解析C++编程中的bad_cast异常
- Java中的异常测试框架JUnit使用上手指南