--Environment - CentOS Linux release 7.8.2003 (Core) - Eclipse IDE for Enterprise Java Developers.Version: 2020-03 (4.15.0) - openjdk version "11.0.7" 2020-04-14 LTS - JSF 2.3.9
java.text.ParseException: Unparseable date: "sampleBean.timestamp"
at java.base/java.text.DateFormat.parse(DateFormat.java:395)
at javax.faces.convert.DateTimeConverter$FormatWrapper.parse(DateTimeConverter.java:489)
at javax.faces.convert.DateTimeConverter$FormatWrapper.access$100(DateTimeConverter.java:470)
at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:437)
at com.sun.faces.facelets.tag.jsf.ConverterTagHandlerDelegateImpl.applyAttachedObject(ConverterTagHandlerDelegateImpl.java:120)
at javax.faces.view.facelets.FaceletsAttachedObjectHandler.applyAttachedObject(FaceletsAttachedObjectHandler.java:60)
at com.sun.faces.facelets.tag.jsf.ConverterTagHandlerDelegateImpl.apply(ConverterTagHandlerDelegateImpl.java:53)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:111)
at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:179)
...abridgement...
f: convertDateTime
(convertDateTime (JSF 2.2 View Declaration Language: JSP Variant) /convertDateTime.html)))javax.faces.convert.DateTimeConverter # getAsObject
is called (DateTimeConverter | JavaServer Faces API (2.2) /index.html?javax/faces/convert/DateTimeConverter.html)))javax.faces.convert.DateTimeConverter.FormatWrapper # parse
is called ([DateTimeConverter.FormatWrapper (Mojarra Implementation Javadoc (2.3))]" (https://javadoc.io/static/org.glassfish/javax. faces / 2.3.0-m04 / javax/faces/convert/DateTimeConverter.FormatWrapper.html#parse-java.lang.CharSequence-))java.text.DateFormat # parse
gives ParseException
I'm stupid but I often do it
<h:outputText value="sampleBean.timestamp">
<f:convertDateTime pattern="yyyy-MM-dd" timeZone="Japan"/>
</h:outputText>
<h:outputText value="#{sampleBean.timestamp}">
<f:convertDateTime pattern="yyyy-MM-dd" timeZone="Japan"/>
</h:outputText>
Recommended Posts