Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JBoss User Help »

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

scott.stark@jboss.org

2007-06-15


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
_______________________________________________
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user
©2008 junlu.com - Jax Systems, LLC, U.S.A.