我想在用户的TimeZone基础上使用不同的TimeZone。
问题:在JSF或Seam中是否有设置默认值的功能?它将影响整个应用程序。
我希望,该功能将是效果s:convertDateTime,f:convertDateTime,p:calendar等.每次我不使用timezone属性就使用。
我还尝试使用Seam组件TimeZoneSelector,如下所示。
@In
private TimeZoneSelector timeZoneSelector;
....
timeZoneSelector.setTimeZone(user.getTimeZone());但是,它不会自动对<f:convertDateTime pattern="hh:mm a"/>产生影响。我必须再次检索支持bean的TimeZone表单。
<f:convertDateTime pattern="hh:mm a" timeZone="#{mybean.timeZone}"/>发布于 2012-12-04 07:29:09
JSF没有默认的特殊特性,允许您这样做。您需要使用此功能的实现。
发布于 2012-12-05 09:31:07
1-为java.util.Date创建默认转换器
2-在getAsString和getAsObject中,转换器从会话中检索用户时区
3-在解析/格式化之前使用SimpleDateFormat.setTimezone()
https://stackoverflow.com/questions/13697667
复制相似问题