On Saturday 24 January 2009 20:17:49 Andy Sykes wrote: > Actually, having an interceptor makes some sense in this case. > > How can interceptors "short circuit" the stack and action to return a > result code? The ideal situation here would be that the "protector" > interceptor is above the validation interceptor, checks for the form > token, and chucks an error result code, protecting the validators from > null parameters and so on. >
Well, the invoke method returns a string indicating which result to dispatch to. Take a look at a few of the other interceptors to see. For instance, if validation fails, the validation interceptor returns "input". > I can't see anything in the documentation about achieving this - the > ActionInvocation javadoc suggests that > ActionInvocation.setResultCode() will not short-circuit the stack, and > that the action's own result code will override the interceptor-set > result. > When an interceptor calls invocation.invoke() it either moves to the next interceptor, or calls the method, depending on where it is in the stack. It fairly intuitive. -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org