You should not rely on managed property setter method invocation order at all. This is nowhere definied in the specification.
Just hook at that point when JSF is finished with setting of all managed properties. That's the @PostConstruct
annotated method.
@PostConstruct
public void init() {
banque = banqueService.find(banqueId);
}
Stop doing business logic in setters, this is only necessary if you're still using legacy JSF 1.1 which didn't support @PostConstruct
.
Unrelated to the concrete problem, are you aware of the new JSF2 <f:viewParam>
? It might as well help you to get rid of this boilerplate in the bean and end up having only a Banque
property and a reusable Converter
.