Spring Webflow - access exception using transition.on-exception attribute

Viewed 8904

I wondering how can I access exception object using on-exception attribute? My current configuration looks like this:

<transition on-exception="{business_exception}" to="errorView" >
</transition>

I have to access some exception attribute in errorView. Does anybody know how can I do it?

2 Answers

rootCauseException and flowExecutionException are the right scoped variables that are accessible in the flow. These variables are populated after the transition to the new flow,so in a pseudo sense:

<transition on-exception="{business_exception}" to="errorView" >
</transition>

<view-state id="errorView">
  <on-entry>
    <evaluate expression="exceptionHandler(flowExecutionException)"/>
    <evaluate expression="exceptionHandler(rootCauseException)"/> 
  </on-entry>
</view-state>
Related