我尝试将参数传送到方法管理员中, 像这样 :
<p:toolbarGroup align="right" rendered="#{loginBean.admin( dataread }">
<h:form>
<p:commandButton value="manage users" ajax="false"
icon="ui-icon-document" action="/admin/manageUsers.xhtml?faces-redirect=true"/>
</h:form>
</p:toolbarGroup>
我经管的豆子的代码就是那样
public boolean isAdmin(String role){
FacesContext facesContext = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
return request.isUserInRole("admin");
}