-1

我必须获取 h:outputtext 的值才能使用表达式语言评估条件。我正在使用下面的代码。但出现“org.apache.jasper.JasperException: /test.jsp(43,20) PWC6296: The function element must be used with a prefix when a default namespace is not specified”错误。

请帮助我如何检查条件。

<h:outputText id="myname" value="Sumit" />
<h:graphicImage height="84px" width="255px" value="/images/LogoDistributor.jpg" rendered="#{element('myname')=='sumit'}"></h:graphicImage>
<h:graphicImage height="84px" width="255px" value="/images/LogoGold.jpg" rendered="#{element('myname')=='sumt'}"></h:graphicImage>
<h:graphicImage height="84px" width="255px" value="/images/LogoPlat.jpg" rendered="#{element('myname')=='Sumit'}"></h:graphicImage>

提前致谢。

4

1 回答 1

0

You should call the function element('...') over its bean class like:

rendered="#{MyBean.element('myname').equals('sumit')}"  

MyBean here, is the class containing the method element('...'). It should be a jsf managed bean.

于 2013-03-01T10:34:49.133 回答