Announcement Announcement Module
Collapse
No announcement yet.
Catching Re-submission error after Browser Back Button Navigation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Catching Re-submission error after Browser Back Button Navigation

    Hello Keith,

    I have seen in one of your posting:
    Some has asked you this:

    * How can I avoid back-buttons, resubmissions etc. I mean I know continuations - but this is not an option in my case. I explicitly asking user not to use back/forward buttons. When user uses these buttons I just want catch that situation, completly discard current flow and show warning. It's possible and easy with spring's Wizard Controller. But can I handle this in web flow?

    and this is what you replied:

    Regarding back button use: yes, it is easy to take a recovery action in response to a failure because of accidental browser navigational button use. People are doing this now: some are using the dispatcher servlet to route to an error page with a restart capability for the flows. Others are capturing the exception within the web flow system and 'rolling back' to the last view state of the flow. We expect to formalize our support and documentation for these types of common error handling strategies before the final release.


    Can you please elaborate(im not clear about how to implement) on this about how to implement it, it would be great if you could point me to some code if you have any.

    Thanks
    Gautam

  • #2
    First, you'll have to switch the flow execution repository from "continuation" to "simple". This will make sure the application (flow) fails when the user uses the back button.
    Second, you'll have to catch the exception that is generated using some techique provided by your hosting framework, e.g. a HandlerExceptionResolver in the case of Spring Web MVC, and resolve it in whatever way you want.

    Erwin

    Comment


    • #3
      Thanks Erwin for your reply,

      I know that simple repository will not allow Back button navigation, but that is not what i want.

      Assume some application like transfering money between two accounts. once the user is done with the transfer and sees the confirmation screen, if user clicks Browser Back button, he would be able to see the previous screen, but there on if he clicks the submit button, he should be presented with error message saying that 'this task is already done'

      If i use simple repository, i will not be able to go back to any screen, but i dont want this method, for all other screens, the user should have freedom to click browser back button and see his/her previous screens.

      Please help me with some ideas...

      Thanks
      Gautam

      Comment


      • #4
        handling browser back button

        is there any way to catch the browser back button event in web flow.

        Comment

        Working...
        X