我试图用这个在JSF动态地显示页面的标题。找不到属性在类型
<h:panelGroup rendered="#{not empty searchBean.fsResultsTitleOne}"><h2>#{msgs.fireStudySearchTitle}</h2></h:panelGroup>
而且我得到这个错误:
rendered="#{not empty searchBean.fsResultsTitleOne}": Property 'fsResultsTitleOne' not found on type
不过,我在定义它的类型是这样的:
private String fsResultsTitleOne;
public String getFSResultsTitleOne(){return fsResultsTitleOne;}
public void setFSResultsTitleOne(String newValue){fsResultsTitleOne = newValue;}
,并将其设置的东西:
setFSResultsTitleOne("I'm not Empty!");
甚至用它来确保这将是SE T:
System.out.println("This is the FS Results Page Title: " + fsResultsTitleOne);
而且它似乎是工作:
This is the FS Results Page Title: I'm not Empty!
我是不是设置错了什么地方?
试着用'FS'较低的情况下's'。这将是更多的Java bean常规。 –
对于这背后的原因,请参阅[这个答案](http://stackoverflow.com/a/21987084/785663) – mabi