This content has been marked as final.
Show 7 replies
-
1. Re: nested session bean calls & dependency propagation
pmuir Nov 27, 2006 10:12 AM (in response to supert24)You need to show your code. Remember to use [ code ] tags
-
2. Re: nested session bean calls & dependency propagation
supert24 Nov 27, 2006 10:30 AM (in response to supert24)In my JSF file:
<h:commandButton type="submit" value="Goto pizza shop.." action="#{a.initial}"/>
In the bean class of session bean a:@EJB public CustomerContext b; public String initial() { b.initial(); }
And finally in the bean class of session bean b:@DataModel private List<MenuItem> outMenuItems=new ArrayList<MenuItem>(); public String initial() { }
My problem now is, that outMenuItems is not propagated to the calling
JSF page. -
3. Re: nested session bean calls & dependency propagation
pmuir Nov 27, 2006 10:34 AM (in response to supert24)Why do you expect the datamodel to be outjected? There is no @Factory and you are instantiating the bean via @EJB not via @In.
-
4. Re: nested session bean calls & dependency propagation
supert24 Nov 27, 2006 10:49 AM (in response to supert24)I dont need a @Factory cause the datamodel is initialized by my code.
However, your proposed@In public CustomerContext b;
cannot not works, since then the JSF page is expected to initialize attribute b. -
5. Re: nested session bean calls & dependency propagation
pmuir Nov 27, 2006 10:56 AM (in response to supert24)"supert24" wrote:
I dont need a @Factory cause the datamodel is initialized by my code.
It is very much easier to help if you post all the relevant code rather than just the snippets.However, your proposed
@In public CustomerContext b;
cannot not works, since then the JSF page is expected to initialize attribute b.
Sorry I don't get what you mean here...
My point is that the outjection of the datamodel from b never takes place as it is not a Seam component, but then its hard to be sure as you haven't posted all your code. -
6. Re: nested session bean calls & dependency propagation
supert24 Nov 27, 2006 11:14 AM (in response to supert24)I now have realized that the DataModel was not outjected because
I leave the method of session bean b by triggering an
exception, which I catch in session bean a.
When you exit a method in that way, no outjecting seems to take place.
Is it a seam limitation or perhaps a general technical limitation when using Dependency Injection? -
7. Re: nested session bean calls & dependency propagation
gavin.king Nov 27, 2006 1:54 PM (in response to supert24)We don't do outjection when the method throws an exception, correct.