Re: Using saveToken and isTokenValid
Good Morning You have written: The view is the result of the first submission anyway. I cannot reproduce this! How cas I achieve that a submit is just replaced once! And that by several clicks the others are just ignored I cannot manage it! If I just forward to the success Configuration Objects that are normally created within the action, cannot by found and a error is raised! Up to know I'm not able to achieve the goal! Thanks nevertheless > > In simple cases i just keep redirecting to the result view (and maybe > warn the user) even if the token is invalid. The view is the result of > the first submission anyway. > > Manos > > starki78 wrote: > > >Hi Thanks but my goal is just to tell > >the user that only the first submit shall be processed! > >My example works only partially > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using saveToken and isTokenValid
In simple cases i just keep redirecting to the result view (and maybe warn the user) even if the token is invalid. The view is the result of the first submission anyway. Manos starki78 wrote: Hi Thanks but my goal is just to tell the user that only the first submit shall be processed! My example works only partially - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using saveToken and isTokenValid
I would assume that you would see only the server response to your last click on submit, that the browser has thrown away the responses from the server for the first and second clicks on submit. Dan - Original Message - From: "starki78" <[EMAIL PROTECTED]> To: "user" Sent: Tuesday, March 14, 2006 10:53 AM Subject: RE: Using saveToken and isTokenValid Hi Thanks but my goal is just to tell the user that only the first submit shall be processed! My example works only partially Nice greetings -- Initial Header --- From : "Kalcevich, Daniel" [EMAIL PROTECTED] To : "Struts Users Mailing List" user@struts.apache.org Cc : Date : Tue, 14 Mar 2006 07:12:32 -0800 Subject : RE: Using saveToken and isTokenValid What about putting the saveToken(request) at the bottom of the second action as well? This will put a new token into the request in the event you want to submit again. Dan -Original Message- From: starki78 [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 7:08 AM To: user Subject: Using saveToken and isTokenValid Hi, I try to create a solution that prevents several submits. Therefore I place at the end of the first action: saveToken(request); and in the second: if (!isTokenValid(request,true)) { // duplicate submit, return some error message to user ActionMessage msg = new ActionMessage("errors.DuplicateSubmit","Don't submit twice"); messages.add("msg", msg); saveMessages(request, messages); return mapping.findForward("error"); } else { normal processing } The result is that then I click three times I get the warning that I would like to know but the first request isn't executed excecuted anymore. Can you help me? Has someone a similar solution? Nice greetings Starky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using saveToken and isTokenValid
Hi Thanks but my goal is just to tell the user that only the first submit shall be processed! My example works only partially Nice greetings -- Initial Header --- >From : "Kalcevich, Daniel" [EMAIL PROTECTED] To : "Struts Users Mailing List" user@struts.apache.org Cc : Date : Tue, 14 Mar 2006 07:12:32 -0800 Subject : RE: Using saveToken and isTokenValid > What about putting the saveToken(request) at the bottom of the second > action as well? This will put a new token into the request in the event > you want to submit again. > > Dan > > -Original Message- > From: starki78 [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 14, 2006 7:08 AM > To: user > Subject: Using saveToken and isTokenValid > > Hi, I try to create a solution that prevents several > submits. > > Therefore I place at the end of the first action: > >saveToken(request); > > and in the second: > > if (!isTokenValid(request,true)) { > // duplicate submit, return some error message to user > >ActionMessage msg = new > ActionMessage("errors.DuplicateSubmit","Don't submit twice"); > > messages.add("msg", msg); > saveMessages(request, messages); > return mapping.findForward("error"); > >} > else { > normal processing > > } > > The result is that then I click three times I get the warning > that I would like to know but > the first request isn't executed excecuted anymore. > > Can you help me? Has someone a similar solution? > > Nice greetings > Starky > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using saveToken and isTokenValid
What about putting the saveToken(request) at the bottom of the second action as well? This will put a new token into the request in the event you want to submit again. Dan -Original Message- From: starki78 [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 7:08 AM To: user Subject: Using saveToken and isTokenValid Hi, I try to create a solution that prevents several submits. Therefore I place at the end of the first action: saveToken(request); and in the second: if (!isTokenValid(request,true)) { // duplicate submit, return some error message to user ActionMessage msg = new ActionMessage("errors.DuplicateSubmit","Don't submit twice"); messages.add("msg", msg); saveMessages(request, messages); return mapping.findForward("error"); } else { normal processing } The result is that then I click three times I get the warning that I would like to know but the first request isn't executed excecuted anymore. Can you help me? Has someone a similar solution? Nice greetings Starky - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]