3 Replies Latest reply on Jun 15, 2007 10:44 PM by matt.drees

    How to do post injection initialization

    tuxzilla

      I want to set some property of a bean right after it is injected into another bean. For example, I want to invoke b.setProperty1(p1) in

      public Class A {
       @In(create=true)
       private B b;
      }


      Do I do this with org.jboss.seam.postSetVariable.b event by adding this inside class A?
       @Observer("org.jboss.seam.postSetVariable.b")
       public void initB() {
       b.setProperty1(p1);
       }
      


      But this doesn't seem to work. I got null pointer exception from b.setProperty1(p1). What is the right way of doing this?

      Thanks.