Size: a a a

Spring Framework and more

2019 May 13

G

Grigori in Spring Framework and more
?
источник

Д

Дмитрий in Spring Framework and more
Uday Kumar
Hi, can anyone tell me how to stop duplicate form request?
What do you exactly mean?
источник

UK

Uday Kumar in Spring Framework and more
When form post method is submitted twice, duplicate data will be inserted, does anyone know how to handle it?
источник

UK

Uday Kumar in Spring Framework and more
In spring boot
источник

Д

Дмитрий in Spring Framework and more
Uday Kumar
When form post method is submitted twice, duplicate data will be inserted, does anyone know how to handle it?
I'd suggest to fix the reasons of that duplication if it is possible
источник

Д

Дмитрий in Spring Framework and more
Otherwise I don't know solution from the box, need more info for any advices
источник

Д

Дмитрий in Spring Framework and more
What does make these 2 requests?
источник

UK

Uday Kumar in Spring Framework and more
After you submit data in registration form, even if you refresh it will be considered as another request,
источник

UK

Uday Kumar in Spring Framework and more
Дмитрий
I'd suggest to fix the reasons of that duplication if it is possible
Thanks anyways 😀
источник

Д

Дмитрий in Spring Framework and more
Registration form should send some id (login email etc), that is what should be used as primary key in db, in that case any duplications will be rejected by db, that is what usually works
источник

AS

Andrey Sidorenko in Spring Framework and more
Uday Kumar
After you submit data in registration form, even if you refresh it will be considered as another request,
If I understand correctly, after 1st request there will be created new record in database, right?
источник

UK

Uday Kumar in Spring Framework and more
Yeah
источник

AS

Andrey Sidorenko in Spring Framework and more
Ok. So you can make "nickname" or "email" unique
источник

AS

Andrey Sidorenko in Spring Framework and more
And check, if user already exists
источник

UK

Uday Kumar in Spring Framework and more
Yeah but if it is a money transaction, i know those solutions 😀
источник

UK

Uday Kumar in Spring Framework and more
I just want to show an error when form data is sent through refresh again.
источник

UK

Uday Kumar in Spring Framework and more
I did that using interceptor but its not working correctly when soring security is added ti project
источник

AS

Andrey Sidorenko in Spring Framework and more
Ahhh
First idea that came:
I think you can use csrf-like token for that
источник

UK

Uday Kumar in Spring Framework and more
Session tokens?
источник

AS

Andrey Sidorenko in Spring Framework and more
Per-request token
Every form on each new page will have it own unique token
источник