cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: How can I retrieve the full request path (URL)?
Date Wed, 02 Jun 2010 21:13:42 GMT
Hi

On Wed, Jun 2, 2010 at 12:55 PM, Tamar Furman (tfurman)
<tfurman@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message