我有 2 个 bean,一个请求范围和 1 个会话范围。我正在尝试通过创建托管属性来访问请求 bean 中的会话范围 bean,但我一直收到错误消息:
com.sun.faces.mgbean.ManagedBeanCreationException: Unable to create managed bean tableBacking. The following problems were found:
- Property resultsBacking for managed bean tableBacking does not exist.
这是我的请求范围 bean:
public class TableLookupBacking {
private ResultsBacking resultsBacking;
public void setResultsBacking(ResultsBacking resultsBacking) {
this.resultsBacking = resultsBacking;
}
}
这是我的会话范围 bean:
public class ResultsBacking {
// mainly strings and ints stored in here with getters/setters
}
这是我的 faces-config.xml
<managed-bean>
<managed-bean-name>tableBacking</managed-bean-name>
<managed-bean-class>backing.TableLookupBacking</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>resultsBacking</property-name>
<value>#{resultsBacking}</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>resultsBacking</managed-bean-name>
<managed-bean-class>backing.ResultsBacking</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>