users@glassfish.java.net

Re: JAX RS / HttpRequest Object?

From: <glassfish_at_javadesktop.org>
Date: Tue, 16 Feb 2010 12:09:45 PST

While I'm not sure if it's possible to get the httpServletRequest object back, it does appear to be possible to get a variety of other pieces of information back.


[code]
@Context
private SecurityContext ctx;

@GET
@Produces("text/plain")
public String getUserPrincipal() {
  return ctx.getUserPrincipal.getName();
}
[/code]

Relevant Forum:
http://www.coderanch.com/t/422684/Web-Services/java/Accessing-HttpServletRequest-from-Restful-webservice
[Message sent by forum member 'hoffman462' (HoffmanDanielG_at_gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=387053