You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by john lee <sh...@yahoo.com> on 2013/06/10 04:29:17 UTC

how interceptor knowing invoke's class name?



in struts2 , defined an interceptor, it triggered by Action, my question is

  inside the interceptor class, what is the function call that can tell caller's name, because that interceptor could be triggered by different Action, we need to log the caller's name, but how?

thanks 

john

Re: how interceptor knowing invoke's class name?

Posted by john lee <sh...@yahoo.com>.
tks chris, that is what i want to know


________________________________
 From: Chris Pratt <th...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>; john lee <sh...@yahoo.com> 
Sent: Sunday, June 9, 2013 9:55 PM
Subject: Re: how interceptor knowing invoke's class name?
 


The interceptor is called by Struts, not by the Action.  But, what I think you are really asking is "How can I tell which Action is being processed when an Interceptor gets invoked?"  If that's your real question, the answer is:

String name = invocation.getInvocationContext().getName();

  (*Chris*)




On Sun, Jun 9, 2013 at 7:29 PM, john lee <sh...@yahoo.com> wrote:


>
>
>in struts2 , defined an interceptor, it triggered by Action, my question is
>
>  inside the interceptor class, what is the function call that can tell caller's name, because that interceptor could be triggered by different Action, we need to log the caller's name, but how?
>
>thanks 
>
>john

Re: how interceptor knowing invoke's class name?

Posted by Chris Pratt <th...@gmail.com>.
The interceptor is called by Struts, not by the Action.  But, what I think
you are really asking is "How can I tell which Action is being processed
when an Interceptor gets invoked?"  If that's your real question, the
answer is:

String name = invocation.getInvocationContext().getName();

  (*Chris*)


On Sun, Jun 9, 2013 at 7:29 PM, john lee <sh...@yahoo.com> wrote:

>
>
>
> in struts2 , defined an interceptor, it triggered by Action, my question is
>
>   inside the interceptor class, what is the function call that can tell
> caller's name, because that interceptor could be triggered by different
> Action, we need to log the caller's name, but how?
>
> thanks
>
> john