I am writing a program, but i encounter a problem: when I refresh the jsp page, system will automatically resubmit the whole page, and i don\'t know how to avoid it, can so
We can use Post/Redirect/Get (PRG) pattern to solve the issue of multiple submission of same data.
It works as follows:
First time when a user submits a form to server by POST or GET method, then we update the state in application database.
Then we send a redirect response to send reply to client.
Then we load a view by using GET command. There is no data is sent in this. Since this a new JSP page, it is safe from multiple submits. The code that processes the request is idempotent. So it does not do same action twice for same request.