You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dmitriy Kuznetsov <he...@yandex.ru> on 2007/04/27 00:54:22 UTC

S2: How to get namespace of currently executed action from interceptor?

Hi.

I have interceptor that logs requests to actions. In it's
intercept(ActionInvocation) method i easily find the name of currently
executed action using following code:

public String intercept(ActionInvocation actionInvocation) {
      String actionName = actionInvocation.getInvocationContext().getName();
      .............
}

I believe i could get the namespace by extracting part of request URL
between context name and action name. But is there any better way, like the
one for action name?

Thanks.

-- 
View this message in context: http://www.nabble.com/S2%3A-How-to-get-namespace-of-currently-executed-action-from-interceptor--tf3654793.html#a10210505
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: S2: How to get namespace of currently executed action from interceptor?

Posted by Felipe Rodrigues <fe...@yahoo.com.br>.
Did you tried use ActionContext?

Regards,

Felipe


Dmitriy Kuznetsov wrote:
> 
> Hi.
> 
> I have interceptor that logs requests to actions. In it's
> intercept(ActionInvocation) method i easily find the name of currently
> executed action using following code:
> 
> public String intercept(ActionInvocation actionInvocation) {
>       String actionName =
> actionInvocation.getInvocationContext().getName();
>       .............
> }
> 
> I believe i could get the namespace by extracting part of request URL
> between context name and action name. But is there any better way, like
> the one for action name?
> 
> Thanks.
> 
> 

-- 
View this message in context: http://www.nabble.com/S2%3A-How-to-get-namespace-of-currently-executed-action-from-interceptor--tf3654793.html#a10226472
Sent from the Struts - User mailing list archive at Nabble.com.


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