I hope somebody could help me with this issue, it's the first time I'm working with JSF after working for three years with Struts2. I need a functionality in JSF to handle double submit on an xhtml page. I mean I have a h:commandButton hich executes an action which registers a group of entities in a database and send an email after this, all this is done, but since it takes some time to perform the operation, the user can click again the submit button, that's why I need to avoid the second click, is there any idea for this?
I'll be grateful if somebody could help me with this please, thanks in advance.
On the server side, I would generally attach some sort of unique identifying token to the data. A transaction ID is always useful, if available. I then interlock at the database transaction level. So a double-submit can happen, but the second attempt to update the database would bounce.
Which leads us to the final part of the triad. If they DO manage to double-submit and they DO bounce, you ideally want to not display the bounce as a error to the client as long as the original transaction was a success.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop