如何在grails gsp中使用g:datePicker来选择时间?
通过在引用 TIME 遗留数据库列的 java.sql.Time 对象上使用 g:datePicker,我收到此错误:
无法将 java.util.GregorianCalendar 类型的属性值转换为属性 jobTime 所需的类型 java.sql.Time;嵌套异常是 java.lang.IllegalArgumentException:无法将类型 [java.util.GregorianCalendar] 的值转换为属性 jobTime 所需的类型 [java.sql.Time]:PropertyEditor [org.codehaus.groovy.grails.web.binding.StructuredDateEditor ] 返回了不适当的值
我已经在整个网络上搜索了几个小时,但仍然不知道该怎么做,有人可以帮忙吗?
By using g:datePicker on java.sql.Time object that refers to a TIME legacy DB column I get this error:
Failed to convert property value of type java.util.GregorianCalendar to required type java.sql.Time for property jobTime; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.util.GregorianCalendar] to required type [java.sql.Time] for property jobTime: PropertyEditor [org.codehaus.groovy.grails.web.binding.StructuredDateEditor] returned inappropriate value
I've searched through the whole web for hours but can't still figure out how to do, is there someone who can help please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您正在尝试将 GregorianCalendar 对象转换为 Time 对象(至少,这就是该对象所说的作用)。尝试手动执行此操作:
如果您绝对确定它是 Time 对象,请尝试将其转换为 Date 对象。
It looks like you're trying to convert a GregorianCalendar object to a Time object (at least, that's what the object says its doing). Try manually doing it:
If you're absolutely sure its a Time object, try converting it to a Date object.