struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gemes Tibor <...@i-trade.hu>
Subject Re: double-click protection and double-update problem
Date Fri, 24 Jan 2003 16:34:40 GMT
2003-01-24, p keltezéssel Olivier Gourment ezt írta:

> I am not using Struts yet, so I am not familiar with the Struts
> specific classes and tags, and I would like to be able to recommend it
> to my customer.

You can create a token with saveToken(request); use this in yor
form-populating action.

And check for it later in the save acion with sg like:

if (!isTokenValid(request)) { 
 ActionErrors errors = new ActionErrors(); 
 errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.token"));
 saveErrors(request,errors);
 return new ActionForward(mapping.getInput()); 
}

This works automagically.

Hth,

Tib


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message