[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Re: Extending EJBInjection interceptor
From:       "David N. Arnold" <david.n.arnold () gmail ! com>
Date:       2008-08-31 2:06:21
Message-ID: 34670f550808301906j27b9ee20g253218ac60348dc3 () mail ! gmail ! com
[Download RAW message or body]

I'm not sure what you mean.  Even though I advised against it, I
explained how to do it.

To be specific, you write an interceptor that scans the incoming
action instance for @EJB annotations.  For each annotation, you check
the HttpSession to see if you already have a reference for the
specified class.  If not, you do the JNDI lookup and store it in the
HttpSession for future use.  And finally, you inject the reference(s)
into the action and call the next step in the invocation chain.

Maybe someone else has some improvements, but that's the general way
it would work.

On Sat, Aug 30, 2008 at 4:31 PM, Alexander Baetz
<baetz.paderborn@arcor.de> wrote:
> As i mentioned, i want to avoid doing the lookup every time. Thats why i
> wanted to write that interceptor.
> But there doesnt seem to be a good way to get Beans without doing the lookup
> directly in the action. At least i didnt find one.
>
> Greetings,
> Alexander

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic