To trigger code before an Action is executed place it before the
invocation.invoke().
To trigger code after an Action is executed place it after the
invocation.invoke();
For example:
public String intercept(ActionInvocation invocation) throws Exception {
MyAction action = (MyAction)invocation.getAction();
// doBeforeActionExecuted(); String result =
invocation.invoke(); // doAfterActionExecuted(); return result;
}
hth,/robert----- Original Message -----
From: "john lee" <sh_thorn_b...@yahoo.com>
To: <user@struts.apache.org>
Sent: Saturday, April 03, 2010 12:53 PM
Subject: struts 2, how to trigger interceptor after action's execute() ?
***************************************************
<package name="me" extends="struts-default">
<interceptors>
<interceptor name="mysimple" class="mysimple">
<param name="name"> try </param>
</interceptor>
</interceptors>
<action name="try" class="try">
<result name="success=">/success.jsp</result>
<interceptor-ref name="mysimple">
<param name="name"> try 2</param>
</interceptor>
</action>
****************************************************
the above code triggers interceptor before class try's execute(), and the
purpose of interceptor,
But, how to trigger interceptor again after class try's execute() ? i check
the stuts 2 document,
it just saying interceptor can trigger before and after execute, but never
give the example for how to do it after execute(),
anyone can help?
tks in advance
john
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org