0

Spring WebFlow フローによるグローバル例外処理。

私はSpring Webflowプロジェクトで作業していますが、誰かがフローにある種のグローバル例外処理を追加する方法を知っているかどうか知りたいので、Java呼び出しのいずれかが例をスローすると、キャッチして同じエラーシステムに持ち込まれますフルシステム用?

私の古いフローは問題なく機能しました:

<var name="member" class="xxxx" />
<decision-state id="checkIsInPending">
   <if test="flowControllerActions.isInPending(member)" then="endStateMemberPending" else="name" />
</decision-state>

グローバルを追加すると、エラーが発生し始めました。

<var name="member" class="xxxxx" />

    <global-transitions>
        <transition on-exception="java.lang.Exception"
                    to="SystemException" />
    </global-transitions>


    <decision-state id="checkIsInPending">
        <if test="flowControllerActions.isInPending(member)" then="endStateMemberPending" else="name" />
    </decision-state>

これが私のエラーです:

org.xml.sax.SAXParseException; lineNumber: 29; columnNumber: 40; cvc-complex-type.2.4.a: Invalid content was found starting with element 'decision-state'. One of '{"http://www.springframework.org/schema/webflow":on-end, "http://www.springframework.org/schema/webflow":output, "http://www.springframework.org/schema/webflow":exception-handler, "http://www.springframework.org/schema/webflow":bean-import}' is expected.
4

2 に答える 2

1

global-transitions を使用して例外をキャッチできます。

<global-transitions>
    <transition on-exception="example.MyBusinessException" to="state3"/>
</global-transitions>

詳細については、ドキュメントを参照してください。

于 2013-01-30T13:30:33.180 に答える
1

XML タグを再配置してみてください。フロー XML が XSD に準拠していないため、この例外が発生しています。Myabe は最後に global-transition を配置しました

于 2013-01-30T13:49:07.403 に答える