JSF页面
<h:form id="form">
<h:inputText id="role" value="HOHOHO"></h:inputText>
</h:form>
Action中,
FacesContext context = FacesContext.getCurrentInstance();
UIInput text=new UIInput();//页面状态域,用于显示页面描述
text=(UIInput)context.getViewRoot().findComponent("form:role");
System.out.println(text.getValue());
这样就得到inputText中的值了