----- Original Message ----- 
From: "sudeepj2ee" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Friday, June 15, 2007 6:51 AM
Subject: In struts 2 can we stop form submiting twice when submit button is 
pressd more than once


>
> Hi
>
> Is there a way out in struts 2 as in struts1.2 for not submitting the form
> twice even is the submit button
> is pressed  more than once.
>
> Your reply will be welcomed
>


You could use the TokenInterceptor:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/interceptor/TokenInterceptor.html

Another way it the execute and wait interceptor:
http://struts.apache.org/2.0.6/docs/execute-and-wait-interceptor.html
[quote]
 This interceptor works on a per-session basis. That means that the same 
action name (myLongRunningAction, in the above example) cannot be run more 
than once at a time in a given session
[/quote]

This does not prevent the user to click many times the submit button, but 
grants you that submit action will be executed only once. If you don't want 
the "in progress" page to be displayed, you could configure a very high 
delay.

I prefer the executeAndWait interceptor because allows to display a pretty 
loading page without additional code, and give the same adavantage of 
TokenInterceptor.

HTH
P.







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to