0

以下是我在 xhtml 中的代码:

<p:row rendered="#{abcBean.xyzmethod}">

在我的豆子里:

public boolean xyzmethod(){
   String def = "ghi";
   if(!def.equal("ghi"){
       return false;
   }
   return true;
 }

我的要求是,如果 xyzmethod 返回 false,我不想显示此行。但是在加载 xhtml 时出现错误:javax.el.PropertyNotFoundException:abcBean 没有属性“xyzmethod”。

我做错什么了吗?请帮忙!

4

1 回答 1

0

它应该是#{abcBean.xyzmethod()}(带括号),因为它是一种方法而不是属性。

于 2015-10-08T18:37:53.663 回答