users@jersey.java.net

[Jersey] Re: HttpServletResponse in Grizzly?

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 21 Feb 2012 09:34:10 +0100

Hello Simon,

I guess you are not able to inject HttpServletResponse because there is
no servlet in your application.

Helloworld sample deploys Jersey app using our integration code with
Grizzly, no servlet is involved, thus you are not able to use servlet
related classes. Try ContainerRequest/ContainerResponse or HttpContext.
And I'm pretty sure that you can inject UriInfo, HttpHeaders,
SecurityContext and javax.ws.rc.core.Request. Just try it out..

To be able to inject servlet related classes, you'll need to run on
servlet. See helloworld-webapp (or any *-webapp) sample.

Regards,
Pavel

On 2/20/12 9:21 PM, Simon Roberts wrote:
> Hi,
>
> I'm trying to learn Jersey/JAX-RS, and have a simple example derived
> from the hello world example, and it's working nicely, except that I
> can't inject an HttpServletResponse (nor, I think, anything else that
> comes from @Context). The problem appears to be that the Grizzly
> container implementation jar files don't appear to include this class.
>
> I'm running this entirely stand along (there's no container other than
> Grizzly, no Tomcat, nor anything else). I'm also running this without
> Maven (I want/need to understand how things fit together, and Maven in
> this case would only serve to hide things)
>
> So, am I missing a jar file, if so which, and where do I find it? Or
> is Grizzly in some way intended to be incomplete? Or perhaps there's
> something else I haven't done?
>
> TIA,
> Cheers,
> Simon
>