This is really impossible. Without this discovery, this will only lead to an endless set-up of managed property.
To get around this, simply put the "parent" bean in the "child" bean when it was introduced.
public class Parent {
private Child child;
public void setChild(Child child) {
this.child = child;
this.child.setParent(this);
}
}
WITH
<managed-bean>
<managed-bean-name>parent</managed-bean-name>
<managed-bean-class>com.example.Parent</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>child</property-name>
<property-class>com.example.Child</property-class>
<value>#{child}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>child</managed-bean-name>
<managed-bean-class>com.example.Child</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
source
share