-
1. Re: using an session ejb as a manged bean
fabmars Oct 27, 2008 3:05 PM (in response to taffb)I think you can't without using other frameworks on top. Check Seam and SpringFaces for example, although I'm not perfectly aware of what's possible with them.
Personally, I declare simple POJO's managed beans which have @EJB injections.
The managed bean may have a method that calls one of the EJB methods. Simple. -
2. Re: using an session ejb as a manged bean
taffb Oct 27, 2008 3:32 PM (in response to taffb)Thanks for your quick reply,
It was the answer I expected, but the one I did not hope for.
Basically I need the call the other way around.
Not that the managed bean call a method in the ejb (that is simple I agree), rather the ejb call a method in the managed bean.
Thanks,
taff -
3. Re: using an session ejb as a manged bean
shadowcreeper Oct 27, 2008 3:47 PM (in response to taffb)Does this not work?
final FacesContext faces = FacesContext.getCurrentInstance(); final SessionBeanWidget sessionBean = (SessionBeanWidget)faces.getApplication().getVariableResolver().resolveVariable( faces, "SessionBeanWidget" );
...assuming you have already created it via your web page with a #{SessionBeanWidget} reference... -
4. Re: using an session ejb as a manged bean
taffb Oct 28, 2008 4:11 AM (in response to taffb)Thanks,
unfortunatley not. The session bean is not in the FacesContext
and when I try to call the facesContext object from the ejb I always get null
I really am at a loss
any (further) help would be greatly appreciated.
thnkas,
taff