users@glassfish.java.net

Re: Resource injection in JSP how to...

From: Edson Carlos Ericksson Richter <edson.richter_at_mgrinformatica.com.br>
Date: Thu, 08 Jun 2006 20:15:14 -0300

Yes... I already read something about it...

Got into my mind I can pass a EntityManagerFactory (that is thread safe)
to the controller, and allow it to open/close entity managers as
needed... then thread problem should be solved...

The question is, when byte code is instrumented to do resource
injection, it's done once per class, or it's done at method entry point?
It's closed after method call that make use of them?


Richter

Jan Luehe escreveu:
> Hi Edson,
>
> Edson Carlos Ericksson Richter wrote On 06/08/06 13:52,:
>
>> ... ok, may be I just made a sidekick on the server... Still
>> interesting way to get resource injection on JSP pages:
>>
>> http://jroller.com/page/brviking?entry=resource_injection_in_jsps_is
>
>
> The reason dependency injection via annotations is not supported on
> JSP pages is because all the information represented by annotations
> needs to be known at deployment time, but if an annotation were included
> in a JSP page, it wouldn't be *seen* at deployment time, because
> annotations
> are stored in bytecode.
>
> Yours is an interesting "workaround", though.
>
>
> Jan
>
>>
>>
>>
>> Richter
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>
>