java - JSF submit button - form is X times submited during one second (until view recreated) - how to prevent it? -


I have a problem when I submit form (by pressing the Enter key or clicking the mouse) - If I press it as fast as X times, then the actual view is rebuilt (like ten times in a second), form data is sent ten times and ten times the database Is saved.

And if there is any validity then no problem, eg. Check that the data can be saved only once

See next, after refreshing, works normally as well. Data has not been saved because legalization is now working ..

Then, the annoying user fills the form and instead of submitting it normally, clicking the View button until submitting that view And I have records in the database instead of x one: -)

How can I stop this strange behavior?

How to refuse to submit the button until the scene is rebuilt?

You want to add something like in your web.xml You can. Another way is to work with the token , which you validate each request and become invalid after the first request so that later requests will fail in your verification.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -