FacesContext context = FacesContext.getCurrentInstance();
UIViewRoot root=context.getViewRoot();//获得前台页面的文件名
List list=root.getChildren();
HtmlForm form=(HtmlForm)list.get(0);//获得<form>节点
list=form.getChildren();
for(int i=0;i<list.size();i++){
UIComponent out=(UIComponent)list.get(i);
if(out instanceof HtmlOutputText){//判断节点类型
System.out.println(out.getId()+"该节点类型为:"+out.getClass());
}
}