users@glassfish.java.net

Re: Jersey or Servlet ?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 31 Mar 2009 16:19:27 +0200

On Mar 31, 2009, at 4:05 PM, Felipe Gaścho wrote:

> ok, I will bet on Jersey,

Great!


> in a hope I can update my project in late
> 2009 to be fully Java EE compliant..
>

As long as you are using EE stuff it "should" work for EE 6.


> please provide me clever references to EJB injection in the Jersey
> code.. (without the old fashion lookup would be nice)
>

See the previous email i sent that contains a link to an email on the
Jersey users list that contains a NetBeans project as an attachment.

Here is the JavaDoc of the Jersey servlet if you want to extend that:

https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.2/api/jersey/com/sun/jersey/spi/container/servlet/ServletContainer.html

Paul.


> On Tue, Mar 31, 2009 at 4:00 PM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
>>
>> On Mar 31, 2009, at 3:43 PM, Felipe Gaścho wrote:
>>
>>> so, I will create a new Restfull service.. than I have this doubt:
>>> to
>>> adopt Jersey or to go with pure Servlet ????
>>>
>>> from Jersey I got JSON and XML formats handling and a lot of cool
>>> features, but I loose EJB dependency injection and other Java EE
>>> features...
>>>
>>
>>
>> It will be supported when EE 6 is ready. However, there are ways to
>> get you
>> boot strapped for what you require in the interim using a plugable
>> injection
>> mechanism in Jersey.
>>
>> See here for an example:
>>
>> http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users+EJB#query
>> :list%3Anet.java.dev.jersey.users%20EJB%20order%3Adate-backward
>> +page:1+mid:catyvvrocdk2h4gx+state:results
>>
>>
>> We have recently got "prototype" support working for JAX-RS
>> resource classes
>> that are no-interface view session beans deployed in the war with
>> the latest
>> Glasssfisg v3 nightly builds. I will send another email to this
>> list when it
>> is fully integrated and working with Jersey. This is interesting
>> because it
>> can reduce the layers you need e.g. the business objects are
>> resources.
>>
>> Another approach is to extend the Jersey servlet and inject what
>> you require
>> on that, and make those injected instances available to the
>> resource classes
>> e.g. via ServletContext or via some custom injectable provider.
>>
>>
>>> from servlet I have a fully Java EE compliant technology, but I miss
>>> the cool annotations of Jersey..
>>>
>>> so, what is the best option ?
>>>
>>
>> Jersey :-), ,but i am biased,
>>
>> It really depends on what you require. As you said Jersey can
>> provide the
>> ease of use w.r.t. to JAXB XML/JSON support, and also matching
>> request URIs
>> to methods.
>>
>> Paul.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
>
>
> --
>
> Please help to test this application:
> http://fgaucho.dyndns.org:8080/cejug-classifieds-richfaces
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>