• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple-submit prevention in JSF

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cay and David,

In Struts, in order to prevent multiple submission, we need to use a token to identify the submit action. How about JSF? Does the same methodology applied?

Nick
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The multi-submit problem is being resolved in JSF 1.2. You can read about the Specification proposal here.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The multi-submit problem is being resolved in JSF 1.2

But currently, we only have JSF 1.0. At the meantime, what should we do to prevent this?

Nick
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition, when will JSF 1.2 implementation release?

Nick
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:

But currently, we only have JSF 1.0. At the meantime, what should we do to prevent this?

Nick


I find that smacking click happy users in the back of the head works wonders.
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nicholas Cheung:

But currently, we only have JSF 1.0. At the meantime, what should we do to prevent this?

Nick


One of the "not so fancy" approach I have seen is once user clicks the submit button, display a dthml saying "Please wait ....." covering your submit button but tht's pretty non-jsf and wont work in case the user refreshes the page.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by K Varun:


One of the "not so fancy" approach I have seen is once user clicks the submit button, display a dthml saying "Please wait ....." covering your submit button but tht's pretty non-jsf and wont work in case the user refreshes the page.


You could also disable the submit button the first time it is clicked.
 
David Geary
Author
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've handled this in JSF with a custom tag that puts unique tokens in both request and session scopes. Then I have a custom action listener that checks to make sure the tokens are present and equal for sensitive form submits.

If you send me email at sabreware@earthlink.net, I can send you a JAR file with the tag and listener.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David.

Just one question, what is the best way for me to obtain a unique *non-random* ticket? I understand that even I generate this ticket using random number, it is of a high chance that the 2 numbers won't be the same within the session, but I have no proof of concept that it really works.

I will send you an email soon.

Thanks.

Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic