2

Is there a way of using spring MVC contollers as subflows in spring webflow?

I have some data browsers written as plain MVC controllers and I would like to use them in my flows to browse/select data.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Łukasz Dumiszewski
  • 2,888
  • 2
  • 21
  • 13

1 Answers1

3

I managed to solve my problem. I am using a view state pointing to an external url (my controller). Here is the example:

<view-state id="itemBrowser" view="externalRedirect:contextRelative:/itemBrowser?callbackUrl=#{flowExecutionUrl}&amp;itemSelectionMode=true">
    <transition on="itemSelected" to="wizardStepBasic">
        <evaluate expression="wizardActions.onItemSelected"/>
    </transition>
</view-state>

The 'callbackUrl' parameter is used at the controller side to return to the flow. For example:

<a href=${callbackUrl}&selectedItemId=${item.id}&_eventId_itemSelected>
    <img src="static/images/accept.png"/>
</a>

Hope, it'll be of some help to somebody :-)

Łukasz Dumiszewski
  • 2,888
  • 2
  • 21
  • 13