You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "Tamar Furman (tfurman)" <tf...@cisco.com> on 2010/06/02 13:55:52 UTC

How can I retrieve the full request path (URL)?

 Hi - 

For internal service logging needs, is there a way to retrieve the full
REST request url on the service method?

Thanks,
T.

Re: How can I retrieve the full request path (URL)?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Wed, Jun 2, 2010 at 12:55 PM, Tamar Furman (tfurman)
<tf...@cisco.com>wrote:

>
>  Hi -
>
> For internal service logging needs, is there a way to retrieve the full
> REST request url on the service method?
>

You can have a JAXRS UriInfo context injected as a field :
@Context UriInfo ui;

and then do either

ui.getAbsolutePath()
or
ui.getRequestURI() - this one will include the query params

cheers, Sergey

[1] https://jsr311.dev.java.net/releases/1.0/javax/ws/rs/core/UriInfo.html


> Thanks,
> T.
>