Revision history [back]

click to hide/show revision 1
initial version

answered 2022-07-04 19:55:01 +0800

IlHam13 gravatar image IlHam13

I need to convert java.time.Instant to the java.util.Date.

I'm using a converter: @converter('formattedLocalDateTime', format='yyyy/MM/dd a KK:mm:ss')

This error occurs:

"ERROR org.zkoss.bind.impl.BinderImpl - class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap') at org.zkoss.bind.converter.sys.FormattedTemporalConverter.coerceToBean(FormattedTemporalConverter.java:34) at org.zkoss.bind.impl.SavePropertyBindingImpl.getComponentValue(SavePropertyBindingImpl.java:131) at org.zkoss.bind.impl.SavePropertyBindingImpl.save(SavePropertyBindingImpl.java:150) "

I need to convert java.time.Instant to the java.util.Date.

I'm using I try to use a converter: @converter('formattedLocalDateTime', format='yyyy/MM/dd a KK:mm:ss')

This error occurs:

"ERROR org.zkoss.bind.impl.BinderImpl - class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap') java.lang.ClassCastException: class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap') at org.zkoss.bind.converter.sys.FormattedTemporalConverter.coerceToBean(FormattedTemporalConverter.java:34) at org.zkoss.bind.impl.SavePropertyBindingImpl.getComponentValue(SavePropertyBindingImpl.java:131) at org.zkoss.bind.impl.SavePropertyBindingImpl.save(SavePropertyBindingImpl.java:150) "

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More