ラベル報告org.apache.struts.action.InvalidCancelExceptionエラー

1550 ワード

ラベル報告org.apache.struts.action.InvalidCancelExceptionエラー
この問題は、もともとできていたが、再コンパイルを忘れて、長い間憂鬱だった.
解決策を見てみましょう.
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 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>