I'm using a hierarchy of classes and what I would optimally try to do is have @ManagedBean
's that inherit a class that have @ManagedProperty
members and @PostConstruct
methods.
Specifically, will this work? :
public class A {
@ManagedProperty
private C c;
@PostConstruct
public void init() {
// Do some initialization stuff
}
public C getC() {
return c;
}
public void setC(C c) {
this.c = c;
}
}
@ManagedBean
@SessionScoped
public class B extends A {
// Content...
}
Thanks in Advance!
@SessionScoped
and the subclasses are@ViewScoped
. I have@PostConstruct
in the superclass and in the subclasses as well. All is working fine. However, I don't know how@ManagedProperty
injection will behave in this set-up. – Knepper