• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple-submit prevention in JSF

 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In addition, when will JSF 1.2 implementation release?

Nick
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic