You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Célio Cidral Junior <cc...@gmail.com> on 2007/08/23 21:51:45 UTC

[S2] How to get the requested path from an interceptor

Is it possible to get the requested path from inside an interceptor?
For instance, the following url was requested:

http://myhost:8080/mywebapp/private/admin/json/companies.action

So, from the interceptor, how can I get the
"/private/admin/json/companies.action" part from that url? I searched
across the ActionInvocation object but could not come with a solution.

Regards,

Célio

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


RE: [S2] How to get the requested path from an interceptor

Posted by Phillip Grenier <pg...@ststravel.com>.
Sourced from http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor

//put the address of the action called originally into the session
String urlGoingTo = invocation.getProxy().getNamespace()+"/"+invocation.getProxy().getActionName()+".action";
        
attributes.put( "GOING_TO", urlGoingTo); 

-----Original Message-----
From: Célio Cidral Junior [mailto:ccidral.newsbox@gmail.com] 
Sent: Thursday, August 23, 2007 3:52 PM
To: Struts Users Mailing List
Subject: [S2] How to get the requested path from an interceptor

Is it possible to get the requested path from inside an interceptor?
For instance, the following url was requested:

http://myhost:8080/mywebapp/private/admin/json/companies.action

So, from the interceptor, how can I get the "/private/admin/json/companies.action" part from that url? I searched across the ActionInvocation object but could not come with a solution.

Regards,

Célio

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


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