provided if the comprehensive route is always the most difficult 2 quick questions- 1)In struts-2.0.11 has resetToken/saveToken/generateToken morphed into a different entity ? 2)can I assume a session.invalidate() will effect a resetToken
Thanks/ Martin- ----- Original Message ----- From: "Givler, Eric" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <user@struts.apache.org> Sent: Tuesday, January 15, 2008 1:36 PM Subject: RE: How do I prevent two calls concurrently? I don't know why I overlooked that. All I had to do was put saveToken() in a calling action, and make sure I called saveToken again if any validation or system errors occurred when I was returning to the form. If the token is invalid, There was a nice thread here about it: http://www.jguru.com/faq/view.jsp?EID=779112. Thanks and apologies for not looking at this first - I guess I was going the more difficult route. Eric -----Original Message----- From: Manos Batsis [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 15, 2008 10:02 AM To: Struts Users Mailing List Subject: Re: How do I prevent two calls concurrently? Givler, Eric wrote: > The problem is the > user double clicks [login] and can get two calls to the service method > to execute simultaneously. They both don't see a row, so they both do > an INSERT. One of the inserts fails due to a PK on the username. See generateToken[1] and isTokenValid [2]. The token will be valid for only one request. What to do with the invalid request (also the latest) is up to you. [1] http://struts.apache.org/1.x/apidocs/org/apache/struts/action/Action.htm l#generateToken(javax.servlet.http.HttpServletRequest) [2] http://struts.apache.org/1.x/apidocs/org/apache/struts/action/Action.htm l#isTokenValid(javax.servlet.http.HttpServletRequest) Cheers, Manos --------------------------------------------------------------------- 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]