我有一個基於用戶角色 的outputText框JSF渲染的outputText是:JSF H:基於用戶角色的outputText渲染條件
<h:outputText id="citizenaddress" value="#{customerView.customerCurrentAddress}" escape="false" rendered="#{facesContext.externalContext.userInRole('isabletoGetCitizenAddress')}"></h:outputText>
的web.xml是:
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
和異常是:
javax.el.ELException: /info/citizenInfo.xhtml @42,193 rendered="#{facesContext.externalContext.userInRole('isabletoGetCitizenAddress')}": Method userInRole not found
可能重複的[渲染基於用戶角色JSF組件(http://stackoverflow.com/questions/4747321/render-jsf-component-based-在用戶角色) – BalusC