Google News
logo
JSP - Interview Questions
How can multiple submits due to refresh button clicks be prevented?
Using a Post/Redirect/Get or a PRG pattern, this problem can be solved.
 
1) A form filled by the user is submitted to the server using POST or GET method. The state in the database and business model are updated.
 
2) A redirect response is used to reply by the servlet for a view page.
 
3) A view is loaded by the browser using the GET command and no user data is sent. This is safe from multiple submits as it is a separate JSP page.
Advertisement