The problem is users double or trible click at the submit button.
The requirement is we need to ignore all the submission except the
first one.
A "ordinary" way to do this is to set
setSynchronizeOnSession(true);
setSessionForm(true);
in SimpleFormController. This will make the request syn and make trying
to
use the form residing in session.
But the issue is how can I ignore the requests other than the first.
I am new to Spring MVC. In Struts, I can simply return null as the
Forward so that browser recieves none response (or just a header that
doesn't cause
browser to update the screen).
In Spring MVC, it will forward to a blank page if I return null as
ModelAndView.
Two questions:
1). Is there a way in Spring MVC to "cancel" a request.
2). Is there a better way to prevent duplicated submission in my case.
Thanks
mark
Andrew Thompson - 26 Sep 2006 05:53 GMT
> The problem is users double or trible click at the submit button.
browser friendly failsafe..
<blockquote>
Only click the button a <b>single</b> time
(unless you wish to be billed twice!).
</blockquote>
Andrew T.
Manish Pandit - 26 Sep 2006 07:57 GMT
Hi,
If this is a struts application, you can use the saveToken() and
isTokenValid() API in your execute() to ensure that you get (or
process!) no duplicate submits. You can google this up for exact usage,
but this is pretty much all you can do from a server side standpoint.
If it is non-struts, you can try to implement the token functionality
in your app in a helper class or so.
-cheers,
Manish
cool2005 - 26 Sep 2006 09:01 GMT
Manish, the problem is not detecting the duplicated submission (I was
able to detect
them without problem) but how to cancel the requests after the first
one.
Here is the question:
How can I cancel a request in Spring MVC? (I can do it in Struts by
returning
null as Forward)
thanks
mark