无法在<f:convertdatetime>中设置时区

时间:2016-02-27 09:29:34

标签: jsf-2 timezone

我正在尝试从支持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;
}

有人可以解释为什么会这样吗?

0 个答案:

没有答案