myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volker Weber" <v.we...@inexso.de>
Subject Re: Flow from backing bean to page while also initializing second backing bean?
Date Thu, 22 Mar 2007 14:00:52 GMT
Hi,

> situations it makes more sense to have separate beans.  I'm surprised that
> there's no way to call custom initializers. In EJB there's a @PostConstruct
> annotation that calls custom logic after the bean manager creates the bean.

not realy a custom initializer, but according to the spec the managed
properties are set in the order they appear in the config. so you can
add a dummy property as the last one which does the initialization.

e.g.:

<managed-bean>
     ...
     <managed-property>
      <property-name>init</property-name>
      <value>true</value>
    </managed-property>
</managed-bean>

public void setInit(String dummy) {
  // call init method
  init();
}

this is what we do if needed.

Regards,
  Volker

Mime
View raw message