users@jersey.java.net

Re: [Jersey] Injection question - Guice + HttpServletRequest

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 07 Oct 2009 22:19:40 +0200

On Oct 7, 2009, at 8:45 PM, Moises Lejter wrote:

> So - I have to confess I originally meant a JAX-RS Provider, not a
> Guice one ...
>

Overloaded terms!


> Would there have been something wrong, if he had/did make it a JAX-RS
> provider, and registered it with the JAX-RS runtime?

Yes, if the ResourceFilterFactory instance was managed by Jersey and
not Guice then it would be possible.

Paul.

> I am guessing that would
> allow injection of other JAX-RS objects when it is created... Any
> maybe allow
> it to be injected into other JAX-RS resources?
>
> Moises
>
> On Wed, Oct 7, 2009 at 1:33 PM, Marc Hadley <Marc.Hadley_at_sun.com>
> wrote:
> On Oct 7, 2009, at 2:06 PM, DirkM wrote:
>
> Marc Hadley wrote:
>
> You can still get the HttpHeaders as a field:
> @Context HttpHeaders headers;
>
>
> I tried that but it gave me a NullPointerException when I tried to
> access
> it. I was under the impression you can only use @Context in certain
> situations, such as within a Resource class...
>
> Right, sorry I thought it was a resource class. My mistake.
>
> Marc.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>