title: Spring Web Flow Preventing Back Button Use
body: <p>So I'm using Spring Web Flow on a project and want to make use of the history="discard" and history="invalidate" attributes on  elements.</p>
  
  <p>I have placed those attributes where I want them, however, when I try to test whether or not they work by navigating to a view after the history attribute is run on the transition, it directs me to an exception page.</p>
  
  <blockquote>
    <p>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.webflow.execution.repository.FlowExecutionRestorationFailureException: A problem occurred restoring the flow execution with key 'e1s1'</p>
  </blockquote>
  
  <p>So sure, it's saying I deleted that state from the history so it can't find it. I don't really see why there isn't some built in mechanism to handle this in the first place, but that aside, I haven't been able to figure out a way to gracefully handle this exception so that I can just redirect them to an error page or would be nicer to just send them back to where they came from.</p>
  
  <pre><code>&lt;view-state id="page1"&gt;
      &lt;transition on="gotoNextPage" to="page2" history="invalidate" /&gt;
  &lt;/view-state&gt;
  &lt;view-state id="page2"/&gt;
  </code></pre>
  
  <p>How is this behavior supposed to be achieved, so that pressing the back button on page2 does not create an exception but just leaves you at page 2?</p>