我用vaadin 6.6和乔达日期时间1.6.2 我用在How to use DateField with Joda DateTime property?Vaadin与乔达日期时间
值描述的方案是设置/获取正确的,但可惜的是我得到的转换异常:
例外是里面扔BeanValidationValidator:
方法是JodaDateTime和价值是java.util.Date JodaTime是不是从日期 分配JodaTime没有String构造
private Object convertValue(Object value) throws Property.ConversionException { // Try to assign the compatible value directly if (value == null || method.getType().isAssignableFrom(value.getClass())) { return value; } else { try { // Gets the string constructor final Constructor constr = method.getType().getConstructor( new Class[] { String.class }); return constr.newInstance(new Object[] { value.toString() }); } catch (final java.lang.Exception e) { throw new Property.ConversionException(e); } } }
你有什么想法?