[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO
Maybe a dumb question, but first one that pops in my head is... do you have getters/setters for the User on your component? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045561#4045561 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045561 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO
Thanks for your reply. I do have the getters setters. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045568#4045568 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045568 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO
I will suggest you the following: (The reasons I do this are in the Seam reference documentation) | @Name(balance) | @Scope(EVENT) | public class Balance implements Serializable | { |private double totalMarketValue; |private double cash; |private double margin; |private String userName; |@In //it suppose the user already is in the session context (an instance) |private User user; |@Logger Log log; | |@Create |public void initialize(){ | this.setTotalMarketValue(0); |this.setMargin(0); |this.setCash(0); | this.setUserName(user.getUsername()); |} | | } | | | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045573#4045573 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045573 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO
anonymous wrote : I got it to work now. | Looks like the problem had to do with referencing the injected user object in the balance objects constructor. if the reference is done in a method other than the constructor, it works. Ah, cool... yeah I'm pretty sure everything works off of setter injection. So the way the container injects your dependencies is by first creating a new instance through the default no-arg constructor and then injecting dependencies using setters for each @In annotation. That's probably why you were seeing problems. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045575#4045575 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045575 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO
I do recall seeing initialize in a bunch of examples. I guess I better give the docs a once over and include an initialize skeleton in my templates. Thanks again. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045577#4045577 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045577 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO
The name initialize does not matter. You can mane as you want, the most important thing here is the @Create annotation, which tells Seam to execute such method just after the component is successfuly initialized (all Seam components are available, ready to be injected). View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4045580#4045580 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4045580 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user