click-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Chinea <manuel.chi...@gmail.com>
Subject Re: EJB 3.1 injection of a SessionBean in a click page
Date Mon, 12 Apr 2010 01:00:31 GMT
Hi Bob,

As far as i have been able to read the cdi specs (an hour this afternoon),
it looks like the managed objects of the jee container get this cdi-magic
out of the box (by managed objects i mean: servlets and jsf on the web side
of things, all the types of ejb from the ejb side). I have found some
information of other web frameworks starting on doing cdi-injection (struts2
and wicket). The Seam framework has also some intregration with wicket.

As for the EJB into a POJO injection, i am not sure. I'll keep on reading.
Glassfish v3 supports jee6, i am already using it in my laptop right now.

I guess a simple way to do this is doing the ctx.lookup of the SLSB.
Could/should it be done in a custom ConfigService or a TypeConverter class
in click? or better in a Superclass?

2010/4/11 Bob Schellink <sabob1@gmail.com>

> Hi Manuel,
>
> Good question. I'm a bit rusty on the latest EJB development, but I'd
> imagine the only way to automatically inject an EJB is if the target class
> was managed by the EJB container. Click Pages are not managed by the EJB
> container so I'd guess you won't be able to do that out-of-the-box.
>
> Changing the question a little. Is it possible to inject EJB into a POJO?
> If it is then it will be possible with Click Pages as well. There is the
> spec: Contexts and Dependency Injection (JSR 299) which from the looks of it
> addresses this problem. I'm not sure which container supports this yet
> though.
>
> kind regards
>
> bob
>
>
>
> On 12/04/2010 02:58, Manuel Chinea wrote:
>
>> Hi,
>>
>> is there a way to inject a SLSB in a click page using the @EJB
>> annotation or something like that?
>>
>> Thnxs in advance
>>
>> --
>> Manuel Chinea.
>>
>
>
regards
-- 
Manuel Chinea.

Mime
View raw message