Martin Gainty
Sat, 30 Aug 2008 16:47:40 -0700
you can use Spring framework to create a proxy which will be cached (from the JNDI lookup)to quote the doc:The EJB local home is cached on startup, so there’s only a single JNDI lookup. Each time the EJB is invoked, the proxy invokes the classname method on the local EJB and invokes the corresponding business method on the EJB. http://static.springframework.org/spring/docs/2.5.x/reference/ejb.html i believe this will accomplish your objective.. anyone ?Martin ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Sat, 30 Aug 2008 22:31:13 +0200> From: [EMAIL PROTECTED]> To: user@struts.apache.org> Subject: Re: Extending EJBInjection interceptor> > 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> > Martin Gainty schrieb:> > did you get a chance to look at using context.lookuphttp://www.tutorialized.com/view/tutorial/EJB-3-and-Struts-Framework-Tutorial-using-JBoss/11894> > by Sebastian Hennebrueder > > public class ListBooksAction extends Action { /** * Method execute * * @param mapping * @param form * @param request * @param response * @return ActionForward */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { > > BookDao bookDao = null; List<Book> books = null; try { > > Context context = new InitialContext(); > > bookDao = (BookDao) context.lookup(BookDaoImp.LocalJNDIName); > > } > > catch (NamingException e) { > > System.out.println("NamingException found message = "+e.getMessage());}> > we could be more assistance if you could describe which alternative lookups you want to implement and provide a few testcases to achieve that objective> > ?Martin Gainty ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > Date: Sat, 30 Aug 2008 16:18:56 +0200> From: [EMAIL PROTECTED]> To: user@struts.apache.org> Subject: Re: Extending EJBInjection interceptor> > Thats a pretty good explanation of how the plugin works....> > I was going to use this method because it was recommended by another > user on the mailing list.> EJB3 is no necessity, but i want to avoid making jndi lookups in every > action i have. Is there another way to achive that?> > Greetings,> Alexander> > ---------------------------------------------------------------------> To unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED]> > > _________________________________________________________________> > Get thousands of games on your PC, your mobile phone, and the web with Windows®.> > http://clk.atdmt.com/MRT/go/108588800/direct/01/> > > > > > ---------------------------------------------------------------------> To unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED]> _________________________________________________________________ Be the filmmaker you always wanted to be—learn how to burn a DVD with Windows®. http://clk.atdmt.com/MRT/go/108588797/direct/01/