[jboss-user] [JBoss Seam] - How to do post injection initialization

tuxzilla do-not-reply at jboss.com
Fri Jun 15 20:16:18 EDT 2007


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.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054929#4054929

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



More information about the jboss-user mailing list