You can either use Spring or implement your own EJB3 interceptor. Though I use my own EJB3 interceptor, I believe the best option is to go with Spring. Google Juice can also be option on the table as well.
--- On Thu, 7/30/09, Robin Mannering <ro...@mtndesigns.co.uk> wrote: > From: Robin Mannering <ro...@mtndesigns.co.uk> > Subject: Re: EJB Injection in Interceptor > To: "Struts Users Mailing List" <user@struts.apache.org> > Received: Thursday, July 30, 2009, 6:17 AM > Just to clear up my actual question > from the thread below as feedback has run dry > unfortunately. > > Is there anybody working daily with Struts 2 and EJB 3.0? > > If so, what is the best way to obtain local references to > EJB 3 session beans from within Struts 2 action classes? > > Thanks for any thoughts on this subject. > > Robin Mannering wrote: > > Just wondering if the below thread has gone any > further. > > > > After creating another thread on the same subject at > an earlier date, we discussed using the EJB plugin here: > > > > http://cwiki.apache.org/S2PLUGINS/ejb3-plugin.html > > > > However, having started to use this plugin so that I > can reference stateless session beans, it seems that all EJB > Session bean classes must be defined as @Remote rather than > @Local in order for the injection to obtain the references > correctly. Failure to specify them as remote throws a > javax.naming.NameNotFoundException. > > > > However, reading from a book entitled "Pro EJB 3.0", > the following performance issues are mentioned in relation > to using @Remote when @Local is available. Hopefully > this link will work for you. > > > > http://books.google.co.uk/books?id=fVCuB_Xq3pAC&pg=PA40&lpg=PA40&dq=Making+an+interface+remote+has+consequences&source=bl&ots=Bg9DdpVAWW&sig=vxrumZhYLhjmqbt6bdMJ96hrY7s&hl=en&ei=QIdtStuLC-WhjAf34KGeCw&sa=X&oi=book_result&ct=result&resnum= > > > > > So, the problem is : > > > > How can we obtain references to EJB 3 session beans > from within Struts 2 action classes? > > > > I'd be very interested to hear your thoughts. > > > > Thanks > > Robin > > > > Nathan Schulte wrote: > >> Wes Wannemacher <wesw <at> wantii.com> > writes: > >> > >>> Seems to me that my idea to create an > ObjectFactory based plugin ... needs to > >>> > >> pick up some steam. > >> > >>> I only have one question for the EJB users out > there... Do you guys need > >>> > >> Spring integration as well? > >> > >> To answer your question, _I_ personally don't need > Spring integration. I've > >> never used Spring, and for this project, it was > too much overhead to learn (on > >> top of Java EE, the JPA, Hibernate intricacies, > Struts2...), and from what I > >> understand, it seemed like using it and S2 > together provided duplicate > >> functionality (another topic altogether...). > >> > >> On another note, I find it awesome that the > community (or whatever group you're > >> part of) is so willing to provide support. I > mean, in my eyes, this is > >> something that I could see myself writing to make > my coding easier, it's just > >> that given my situation, it's easier to use the > "workaround." Admittedly, I'm > >> not very familiar with JEE5. Some of this is > still black magic, and I don't > >> fully understand the issue, I just know enough to > understand that the > >> architecture permits it as an issue (and not > everyone is just blowing smoke my > >> way) and can leave all of the intricate details > be, as they don't directly > >> affect my project. > >> > >> -Nate > >> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> ------------------------------------------------------------------------ > >> > >> > >> No virus found in this incoming message. > >> Checked by AVG - www.avg.com Version: 8.5.387 / > Virus Database: 270.13.20/2248 - Release Date: 07/19/09 > 05:57:00 > >> > >> > > > > > ------------------------------------------------------------------------ > > > > > > No virus found in this incoming message. > > Checked by AVG - www.avg.com Version: 8.5.392 / Virus > Database: 270.13.31/2265 - Release Date: 07/26/09 17:59:00 > > > > __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org