spring jspのフォームモデルをhibernateで定義していて フォームからpostした時、notnull指定していないのにdate型入力なしでも 検証が走り下記エラーで落ちる。入力しないdate型もあるのでこのエラー不要! ※string型は問題なく 入力していなくても検証されない。
エラー org.springframework.validation.BeanPropertyBindingResult: 'ContactForm' on field 'contacts[2].limit': rejected value []; codes [typeMismatch.ContactForm.contacts[2].limit,typeMismatch.ContactForm.contacts.limit,typeMismatch.contacts[2].limit, typeMismatch.contacts.limit,typeMismatch.limit,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support. DefaultMessageSourceResolvable: codes [ContactForm.contacts[2].limit,contacts[2].limit]; arguments []; default message [contacts[2].limit]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'contacts[2].limit'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type @javax.persistence.Column java.util.Date for value ''; nested exception is java.lang.IllegalArgumentException] Field error in object