我正在尝试从支持bean获取 timezone 属性,但它失败了,因为在启动其值之前调用了getter()。
以下是代码片段:
<p:outputLabel value="#{bean.startDate}">
<f:convertDateTime pattern="#{msg['dateformat.yyymmdd']}"
timeZone="#{bean.timezone}" />
</p:outputLabel>
支持bean:
public void init(){
timezone= getUserTimeZone();
}
public String getTimezone() {
return timezone;
}
有人可以解释为什么会这样吗?