Prevents repeated forms and forms from being submitted.
Method 1: javascript control. Disadvantage: Generally, it is okay for users to use it. However, if you know something about js, you can force repeated submission. In addition, there is no way for you to submit it after you move it back.
Method 2: Server Control.
A token is generated in the background and stored in the session or other cache. During form rendering, a hidden token is provided to form ).
When a user submits a form:
First, determine whether the token in the form exists and reject the data;
If a token exists, check whether the token in the form is consistent with the token in the session. If the token is inconsistent, the data is denied. If the token is consistent, process the form and remove the token from the session.
After the user successfully submits the form, if the user submits the form again, the token in the session will be deleted, so that the server will tell the user "do not submit the form repeatedly !".
The code is not attached. That's all.