So normally in a servlet, I'd do a simple:
HttpServletRequest request;
request.getRemoteAddr();
to retrieve the user currently hitting my WS.
How would I do the same from a jersey webservice?
I originally attempted to do something like:
@GET
@ProduceMime("text/xml" )
@Path("/ftpRestart" )
public String echoCallingIP(@Context HttpRequestContext context ) {
context.getRequest();
}
But the HttpRequestContext reveals nothing useful at all here.
I'm sure there's a way to do this, but perhaps I'm just going about it the
wrong way. Anyone have any clues on how to do this (I swear this should be a
lot simpler than I'm making it out to be).
Junos