users@jersey.java.net

Re: [Jersey] Using Guice with JAX-RS

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 02 Oct 2008 09:52:54 +0100

On Oct 2, 2008, at 6:40 AM, Gili wrote:

>
> Paul,
>
> I'm trying to use the Spring-Jersey bridge as a model for the Guice
> one...
>
> It looks like SpringResourceProvider.java:194 falls back on Jersey's
> built-in resource providers whenever possible. Why is that? Why
> doesn't it
> simply use Spring to inject all resources?
>

What does Guice have for declaring life-cycle?

For Spring, with autowire support, we wanted to reuse the @Scope
annotation, rather than having to additionally declare the Jersey-
based annotations (for the resource provider), as this leads to much
better integration. But we also wanted to ensure that things work if
such Jersey annotations are declared.

Paul.