Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Duplicate submission prevention

Thread view: 
cool2005 - 26 Sep 2006 05:38 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.