struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignacio de Córdoba <icord...@skios.es>
Subject Re: Struts and EJB 3
Date Fri, 06 Mar 2009 11:24:26 GMT

Hi,
I'm us¡ng JBoss and @EJB doesn't work either. Are you using Struts1 or
Struts2? If Struts2, You can use the extension for EJB3 for Struts2. It
works OK (interceptor).


senderj wrote:
> 
> My env is Netbean with Glassfish. I am able to create a servlet to call
> EJB with this code:
> 
> public class TryAdvise_create extends HttpServlet {
>     @EJB
>     AdviseFacadeRemote advBean;
>     ......
>     protected void processRequest(HttpServletRequest request, ........ {
>     ......
>         Advise adv = new Advise(123, "123 Company");
>         advBean.create(adv);
>    
> It works great. But when doing the same on a Struts Action:
> 
> public class TryAdviseAction extends Action {
>     @EJB
>     AdviseFacadeRemote advBean;
>     ......
>     public ActionForward execute(ActionMapping mapping, ......... {
>         Advise a = advBean.find(new Long(1));
> 
> advBean is always null. Why? Please help.
> 

-- 
View this message in context: http://www.nabble.com/Struts-and-EJB-3-tp22368697p22369485.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message