rendered属性是用来控制该控件是否显示的,结果为ture时显示,false隐藏
例:
页面
<h:commandButton id="login" value="Login" action="#{login.login}" rendered="#{!login.loggedIn}"/> <h:commandButton id="logout" value="Logout" action="#{login.logout}" rendered="#{login.loggedIn}"/>
java
public boolean isLoggedIn() { return currentUser != null; }