users@jersey.java.net

Re: [Jersey] _at_EJB with jersey ?

From: Julio Faerman <jfaerman_at_gmail.com>
Date: Fri, 25 Jul 2008 15:21:30 -0300

The spec reads:
"An implementation MAY offer other resource class lifecycles,
mechanisms for specifying these are outside
the scope of this specification."

Would it be possible to specify a factory for Resources? If so, it
could lookup and inject the @EJB there, while we wait JEE 6.
If not, i guess a superclass constructor could also do it.
Right?

On Fri, Jul 25, 2008 at 1:25 PM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
> Felipe Gaścho wrote:
>>
>> I have an EJB and I was wondering if I can make a reference to EJBs in
>> Jersey annotated classes, something like:
>>
>> @UriTemplate("/test")
>> public class TestService {
>> @EJB
>> private PricesFacadeLocal prices;
>>
>> @HttpMethod("GET")
>> @ProduceMime("text/html")
>> public String getPrice() {
>> String result = "<html><head><title>Shoes list</title></head><body>";
>> result += prices.getPrice(1);
>> result += "</table></body></html>";
>> return result;
>> }
>> }
>>
>> * I am considering to run this code on Glassfish...
>>
>
> See here:
>
> http://blogs.sun.com/sandoz/entry/ejb_injection
>
> Jersey is not compliant with EE yet, we are waiting for JAX-RS alignment to
> EE6. But in the interim it is possible to have target support for various
> aspects (or use Spring).
>
> Paul.
>
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>