To forestall double submits, and "back button" resubmits, the framework can generate a token that is embedded in the form and also kept in the session. If the value of the tokens do not compare, then we know that there has been a problem, and that a form has been submitted twice or out of sequence.
may want to look at implementing default-interceptor-ref as a double-submit guard e.g. user-submit struts.xml: <interceptors> <interceptor name="authentication"= class="mailreader2.AuthenticationInterceptor"/> <interceptor name="token-session" class="com.opensymphony.webwork.interceptor.TokenSessionStoreInterceptor"/> <interceptor-stack name="user" > <interceptor-ref name="authentication" /> <interceptor-ref name="defaultStack"/> </interceptor-stack> <interceptor-stack name="user-submit" > <interceptor-ref name="tokenSession" /> <interceptor-ref name="user"/> </interceptor-stack> <default-interceptor-ref name="user-submit"/> </interceptors> <action name="Subscription_save" method="save" class="mailreader2.Subscription"> <interceptor-ref name="user-submit" /> </action> you can d/l what you need from here http://svn.apache.org/repos/asf/struts/struts2/trunk/apps/mailreader/src/main/webapp/tour.html or you can d/l the entire struts2 distro and seek for tour.html (under mailreader) HTH Martin ______________________________________________ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: andrh...@hotmail.com > To: user@struts.apache.org > Subject: RE: stream result causing action to be called multiple times > Date: Tue, 5 May 2009 08:40:43 -0500 > > > >> is multiple equal 2? > > > > It calls the action between 2 and 4 times, but usually 3. I was thinking an > interceptor would somehow call the action multiple times but maybe that's not > possible. I don't fully understand how interceptors call actions. etc yet :) > > > > I was testing on a Mac. OSX/Firefox. I will try testing on windows/IE. > > > > Thanks > > > > > Date: Tue, 5 May 2009 04:08:49 -0200 > > Subject: Re: stream result causing action to be called multiple times > > From: poulw...@gmail.com > > To: user@struts.apache.org > > > > Hi Andy, > > > If so maybe the browser is doing it because it doesn't know everything > > about this file - size comes to mind. > > If i remember correctly some browsers will do that. > > > > best greetings, > > Pawel Wielgus. > > > > 2009/5/4, Andy <andrh...@hotmail.com>: > > > > > > Hi, I have an action that returns a stream result type and for some reason > > > my action is getting called multiple times: > > > > > > <result name="attachment" type="stream"> > > > <param name="contentType">${attachmentContentType}</param> > > > <param name="contentDisposition">filename="${attachmentFileName}"</param> > > > </result> > > > > > > This causes some inefficiency since the action is retrieving an image from > > > the database on each call. IDeas? > > > > > > I am on 2.16 and using default interceptor stack. > > > > > > Thanks > > > > > > _________________________________________________________________ > > > Hotmail® goes with you. > > > http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > _________________________________________________________________ > Hotmail® goes with you. > http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 _________________________________________________________________ Windows Live™: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009