0

Is there any way to differentiate a browser back button request and a submit request in the listener?

Is there a way to do server side validation when a user hits browser back button & forward button consecutively?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Morween
  • 1
  • 1

1 Answers1

0

Is there any way to differentiate a browser back button request and a submit request in the listener?

Not in the server side. The back button request is namely not necessarily been sent to the server, but instead requested on the browser's cache.


Is there a way to do server side validation when a user hits browser back button & forward button consecutively?

Just tell the browser to not cache the page at all. This way it will guarantee send a full request to the server side where all the associated code will be invoked.

You can find a kickoff example of such a filter in this answer: Avoid back button on JSF web application.

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555