One approach to solving the duplicate submission problem is to use
the Synchronizer Token pattern from Core J2EE Patterns by Alur, Crupi and Malks, as discussed
here.
As a solution to multiple clicks, the synchronizer token pattern has pros and cons...
Pros.
It can be implemented without changing the HTML templates: the token is quietly put in the form by specifying @Persist("client:form") in java.
Being a server-side solution, it was popular back when javascript was often not present in web browsers or turned off.
Cons.
DirectLink does not participate because it doesn't trigger pageBeginRender().
If the listener ignores resubmission, then the current page will be redisplayed instead of the result page.
If the listener prevents resubmission, then an error page will be displayed instead of the result page.
Tapestry exceptions If you get an exception saying a property "has already been accounted for by the element
at Annotation" then restart JBoss with -Dorg.apache.tapestry.disable-caching=false before using this page.