0

I have an excepton handler at the webflow level

<exception-handler bean="webflowExceptionHandlerBean"/>

Also I have two different flows, Flow A and Flow B. Flow B is a sub-flow of Flow A.

Flow A

<flow>
  <on-start>
    <!-- SOME SET -->
  </on-start>
  <view-state id="viewStateA">
    <transition id="goToFlowB" to="flowB"/>
  </view-state>
  <subflow-state id="flowB" subflow="flowB">
  </subflow-state>
</flow>

Flow B

<flow>
  <on-start>
    <!-- SOME SET -->
  </on-start>
  <view-state id="flowB">
    <on-entry>
    <!-- HERE THE EXCEPTION IS THROWN -->
    </on-entry>
    <transition id="goToT1" to="t1"/>
  </view-state>
</flow>

So when an exception is thrown in the on-entry of the Flow B that is not catch by the webflowExceptionHandlerBean

The configuration of the webflowExceptionHandlerBean implements FlowExecutionExceptionHandler

I've tried using and it worked, but I wana use just one global exception handler on each flow.

Do you know what happend? Am I missing something?

Piero Divasto
  • 1,065
  • 13
  • 21

1 Answers1

0

Have an abstract flow definition like below

<flow xmlns="http://www.springframework.org/schema/webflow"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/webflow
                            http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd" abstract="true">
<exception-handler bean="webflowExceptionHandlerBean"/>
</flow>

Then, inherit the abstract flow into your flow A and flow B like below

<flow xmlns="http://www.springframework.org/schema/webflow"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/webflow
                            http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd" parent="abstract-flow">

You should be able to globally handle your exceptions using custom exception-handler