Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts and DynaValidatorForm

Reply
Thread Tools

Struts and DynaValidatorForm

 
 
Anders Steinlein
Guest
Posts: n/a
 
      08-26-2003
I have an HTML form that maps to a DynaValidatorForm I have specified in
the struts-config.xml file. Everything works fine, but I have come across
a potential problem I don't know how to solve:

If the user quickly clicks the submit button multiple times, my Action
and corresponding database calls are requested for each click! As
impatient users are bound to multiple-click from time to time, what is
the best way to solve this? Definately preferably with still being able
to use DynaValidatorForm...

Thanks!

\Anders
 
Reply With Quote
 
 
 
 
Wolfram Rittmeyer
Guest
Posts: n/a
 
      08-27-2003
Anders Steinlein wrote:
> I have an HTML form that maps to a DynaValidatorForm I have specified in
> the struts-config.xml file. Everything works fine, but I have come across
> a potential problem I don't know how to solve:
>
> If the user quickly clicks the submit button multiple times, my Action
> and corresponding database calls are requested for each click! As
> impatient users are bound to multiple-click from time to time, what is
> the best way to solve this? Definately preferably with still being able
> to use DynaValidatorForm...
>
> Thanks!
>
> \Anders


You could generate a unique token which is generated before the jsp-page
is to be called (in your action therefore). Then you place this token in
a hidden form-field of your JSP and in the following Action you check
whether this token has already been used. If not, mark it as used and
perform you're DB-related code. If used, just ignore the DB-related
tasks and simply prepare the next view.

So you must have some way to deal with these tokens (could be a seperate
class which stores these in an HashTable with the token as key and the
status as a wrapped boolean - this of course should be using
getters/setters which are implemented in a thread-safe way).

Wolfram Rittmeyer
http://www.jsptutorial.org



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DynaValidatorForm and Update Object pit_IN Java 0 07-30-2006 08:57 PM
Eclipse and Ant with Struts: how to combine to generate javadoc api, how to map struts source to binary code for debugging Merlijn Java 0 03-24-2006 01:47 PM
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
Struts + DynaValidatorForm + ValueObject as form property ---JSP Access? javaguy44 Java 0 04-26-2004 04:10 PM
Struts - DynaValidatorForm Ron Java 2 02-24-2004 07:42 AM



Advertisments