我想问你是否可以将值注入到 bean 的子属性中。
这是我想做的,但 Eclipse IDE 抱怨:
在父类 paq.paq.BeanA 上找不到 Bean 属性 beanB.subprop
<managed-bean>
<managed-bean-name>beanA</managed-bean-name>
<managed-bean-class>paq.paq.BeanA</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>beanB.subprop</property-name>
<value>Hello!</value>
</managed-property>
</managed-bean>
public class BeanA implements Serializable {
public BeanB beanB = null;
public Skin getBeanB() {
if (this.beanB == null) {
this.beanB = new BeanB();
}
return this.beanB;
}
public void setBeanB(BeanB beanB) {
this.beanB = beanB;
}
}
public class BeanB implements Serializable {
public String subprop = null;
public String getSubprop() {
return this.subprop;
}
public void setSubprop(String subprop) {
this.subprop = subprop;
}
}
谢谢!