nukipo
nukipo

Reputation: 31

Disable button refresh browers

I have a problem with sending message. I create a jsp page with calling form to send message using method Post. when i click button refresh on browers FF, it automatically send message again. I don't want to again send it. How could i disable button refresh?.

Upvotes: 1

Views: 182

Answers (1)

Quentin
Quentin

Reputation: 943185

You can't.

Instead, use the POST-Redirect-GET pattern.

  1. Let the form be POSTed to the form handler
  2. Process the form data to send the message
  3. Redirect to another URI
  4. The browser will GET the other URI
  5. If the browser is refreshed, the other URI will be requested with a GET, the form will not be resubmitted.

Upvotes: 11

Related Questions