【发布时间】:2011-09-21 07:37:52
【问题描述】:
我有以下代码:
@Named
@RequestScoped
public class SearchBean{
private String title;
private String author;
// .... getters and setter s
}
在search.xhtml 我有:
<h:inputText value="#{searchBean.title}" />
<h:commandButton action=#{srchUI.action}"/>
我还有以下ControllerBean:
@Named("srchUI")
@RequestScoped
public class SearchUIController {
public String action(){
// ...
}
}
我想在action() 方法中访问SearchBean.title... 怎么做?如何在我的 UI 控制器中注入这个 bean?
【问题讨论】: