users@jersey.java.net

Re: [Jersey] Newbie question: How do I inject objects into resources

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 25 Mar 2009 18:55:20 +0100

Hi David,

Unfortunately the root of the problem is this:

   - there is no standard IoC technology in the JDK.

I really wish there was! There is not much JAX-RS can do about this.
And we certainly do not want to standardize any such technology in JAX-
RS itself.

I do not think the situation is completely useless. I think Tatu makes
some good points in this respect. But still for SE you will require
some non-standard glue code. Note that you mention non-standard
technologies like Jetty, Grizzly, or Simple so if you want to
integrate those you need to use something framework specific anyway as
there is no standard for deployment and use of those technologies.

Paul.

On Mar 25, 2009, at 6:17 PM, David Fogel wrote:

> Hi Craig, Paul-
>
> Thanks for responding, and I think that does answer my question.
>
> What this seems to mean is that JAX-RS is not a stand-alone
> specification, and any implementation of it is essentially useless
> without extra features outside the realm of what's covered by JAX-RS
> itself (specifically the ability to access any kind of application
> state or services), which in turn seems to imply that there's
> essentially no such thing as _portable_ JAX-RS code, and never will
> be.
>
> I suppose that this is no big deal for users who are already committed
> to using big JEE application server stacks (and who additionally don't
> mind waiting a while for EE6 and Web Beans to sort themselves out
> before being able to develop anything).
>
> But for users (like me) who are interested in lighter-weight, or at
> least non-JEE, development stacks (in my case OSGi + a java web server
> like Jetty, Grizzly, or Simple, perhaps not even using the Servlet api
> at all) this is disappointing. JAX-RS looks initially like it could
> be a great new baggage-free _standard_ for unifying the common task
> of writing a web application and an accompanying web service. And
> most of the glowing introductions to JAX-RS technology in articles and
> documentation strongly imply this.
>
> But it seems that to use JAX-RS in a non-JEE environment is really to
> use JAX-RS-Jersey-Spring, or JAX-RS-Jersey-Guice, or
> JAX-RS-Resteasy-Spring, or JAX-RS-Restlet, etc all of which do things
> differently. Which is kind of a bummer.
>
> I suppose I should just be happy that open source libraries and
> tooling is getting better at supporting RESTful web development (and
> Jersey seems like it's playing a big role here). I just wish I didn't
> feel a little mislead with respect to JAX-RS....
>
> Thanks,
> -Dave Fogel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>