1

我有一个抽象BaseListBeantableType

public abstract class BaseListBean {
     private String tableType;
}

子 bean 如下所示:

@ManagedBean
@ViewScoped
public class FunctionListBean extends BaseListBean {
   ...
}

我的问题是:如何tableType从另一个托管 bean 访问?

@ManagedBean(name="requestBean")
@RequestScoped
public class requestBean {
    //this is needed
    private String tableType;

}

现在的工作是将子 bean 用作托管属性,例如functionListBean

@ManagedProperty(value = "#{functionListBean}")
private FunctionListBean functionListBean

接着

functionListBean.tableType

但是我想要的是tableType当前存在的Bean,那我该怎么做呢?

4

0 回答 0