Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [s2] Struts Dependency Injection and EJB3 - support ? or how
can i Do it?

Ian Roughley

2007-01-22

Replies:

Currently there is no EJB3 support in Struts, however I have done this
on a couple of projects. I used a custom annotation to mark action
setters as ejb3 then a custom interceptor that looks for the annotation,
looks up the ejb3 and injects it into the action. Doing it this way is
less than a days work.

Another option would be to replace the ObjectFactory (the class that
does the dependency injection) with a a custom implementation that does
EJB3 dependency injection.

/Ian

--
From Down & Around, Inc.
Innovative IT Solutions
Software Architecture * Design * Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
web:    www.fdar.com
email   ian@(protected)
phone:   617.821.5430
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



papo wrote:
> Hello
>
> I am trying to find a way of calling efficienlty from Struts Actions
> -> SLSBs EJB3. I have made a question before.
>
> - Doing JNDI calls all the time through every action works though its
> a very primitive way of doing it.
> -Tried to implement the Service locator pattern though the semantics
> on EJB3 are different (how to cache Intefaces, which interfaces)
>
> I know tha EJB3 on the web layer Serlvets/ JSF supports Dependency
> Injection for EJB3.
>
>
> Will Struts 2.0 support such a feature if NOT can anyone point me the
> mechanics so to (try) doing it on my own.
>
> I am bit stuck for days at this very point of efficiently glue-ing
> Struts and my EJB3 Business layer
>
> Any hint would be much appreciated!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.