0

I am using struts2 framework for my application.I have two pages. Page1 with form1 having modifiable data and submit button. I am using token session interceptor to prevent form re submission . On clicking submit from page1 it will call an action and navigate to Page2 and show the success/failure result.

The problem is if I use browser back button from Page2 to navigate back to Page1 and modify some form1 data and click submit, token session interceptor not calling the action again instead navigating to Page2 with previous result .

While using browser back button I need to prevent form re-submission if there is no change in data, on the other hand I need to submit the data if there is a modification.

1 Answers1

0

You need to tell the browser not to cache anything, so when the back button is clicked, the browser tries to load the page again. For this purpose you need to write a caching interceptor that will set headers to response to instruct the browser to not cache pages. See Why after logout clicking back button on the page displays previous page content.

Community
  • 1
  • 1
Roman C
  • 49,761
  • 33
  • 66
  • 176