1

I have developed 4 jsp pages , and they should be accessed in sequence . Is there a way to stop user to go back ? can I give a prompt also when user tries to go back

1 Answers1

0

You can stop the user from going back to previous page by disabling the back button via JavaScript. But it will not solve the issue completely as user can use the URL and can put it in address bar if the URL is changing in case sendRedirect method. In addition to that for a user you can maintain some counter representing the page in your application on which user can go.if user hits the URL then you can do a server side validation if the page is the correct page or not. If the page requested is not the correct page of the sequence then do the redirection on correct page. You can try the combination of forward and disabling the back-button.
For reference how to stop browser back button using javascript

Narendra Jaggi
  • 1,297
  • 11
  • 33