[jboss-user] [JBoss Seam] - Re: Injection of SESSION POJO into event/session scoped POJO

fernando_jmt do-not-reply at jboss.com
Mon May 14 14:06:54 EDT 2007


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=bb&op=viewtopic&p=4045573#4045573

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045573



More information about the jboss-user mailing list