This content has been marked as final.
Show 4 replies
-
-
2. Re: ouject a non seam bean
mousstik Apr 19, 2007 4:26 AM (in response to mousstik)ok
@Name("seam1") @Scope(ScopeType.CONVERSATION) public class Seam1Action { private Model model; .... private String updateModel{ // method called on an actionCommand in JSF // .... setModel(model); } }
@Name("seam2") @Scope(ScopeType.CONVERSATION) public class Seam2Action { @In private Seam1Action seam1; public Seam2Action() { sysout(seam1.getModel().toString()); } ... }
This code returns a null pointerException.
When I comment the sysout and put<h:outputText value="#{seam2.seam1.model.attribute}" />
it works ??? -
3. Re: ouject a non seam bean
mousstik Apr 19, 2007 5:13 AM (in response to mousstik)Ok, sorry.
I can't get my object Model in the constructor. My Model has not yet been created by seam...
When I get in a getAttribute, it works very well.
Thanks -
4. Re: ouject a non seam bean
sammy8306 Apr 19, 2007 6:37 AM (in response to mousstik)You can't access injected beans in the constructor. Instead, use a method annotated with @Create to do this kind of initialization stuff.