Thank you Ted, I want just asking me exactly what you answered. Perfect! I will try this...
On 10/16/06, Ted Husted <[EMAIL PROTECTED]> wrote:
In Struts 2, the Interceptors are designed to do all the work. There shouldn't be any token code in an Action class at all. There are three flavors, the Token Interceptor, the Token Session Interceptor, and the Execute and Wait Interceptor. The Token Interceptor is most like the Struts 1 approach, except that we don't have to change the Action class to add a lot of busy code. The tradeoff is htat we *do* have to include the token tag in the form, to bootstrap the process. In Struts 1, we set the token in the Action, and the form tag detected it. In Struts 2, we set the token in the page, and the Interceptor detects it. If the Interceptor does detects a duplicate submit, then it automatically returns an "invalid.token" result code, which can be handled via the action mapping. * http://cwiki.apache.org/confluence/display/WW/Token+Interceptor The Token Session interceptor tries to be even more automatic by attempting to display the same response that the original, valid action invocation would have displayed if no multiple requests were submitted in the first place. * http://cwiki.apache.org/confluence/display/WW/Token+Session+Interceptor The Execute and Wait Interceptor embraces long-running taks by presenting a progress meter as the Action runs in the background. * http://cwiki.apache.org/confluence/display/WW/Execute+and+Wait+Interceptor HTH, Ted. * http://www.husted.com/struts/ On 10/13/06, Sébastien LABEY <[EMAIL PROTECTED]> wrote: > Hi, > Is it always possible with Struts2 to manage the Token manually with > saveToken(), resetToken().. ? I'm trying to upgrade from Struts1.2.8 to > Struts2.0, and I would like not to modify all the existing (and working) > code... > I've seen there is a TokenTag to put a token (into request I suppose) and 2 > Interceptors to check weither the token is valid and avoid problems with > multiple submission, but this means I've to be sure that all pages have the > TokenTag inside if I want to deal correctly with tokens. If I can put and > remove it myself in my "mother" Action class (extends ActionSupport), it is > done only one time, and I'm sure all pages will support it. Does someone > have a better solution? > Thanks. > > Sebastien --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]