Search code examples
javaspringweb-applicationsspring-webflow

How to interrupt a Spring Web flow and Cleanup the resources


In the page, there is jquery Overlay. On the initialization of the overlay, the flow starts. The transition occurs with the AJAX call. As the transition of flow happens, we replace the content of the overlay with the ajax response and update the acion and event for next transition.

The flow contains around 10 Step and user can terminate at any point by pressing ESC and clicking on the Close Button.. This can disappears the overlay.

If i copy the url of any state and paste it in new window of the same browser, it display the content of that state.

Question: How can i cleanup the resources whenever user terminate in between the view state?


Solution

  • It sounds like you need to catch the close/esc statement and send an ajax request down the flow controller to reset the flow.

    Other than that it's of course possible to remove the cookie that keeps your session but I would go with the first approach.