Spring mvc Joda Datetime converter fail if invalid date

后端 未结 1 824
不知归路
不知归路 2021-01-19 04:35

I have a domain object that i want to have mapped from JSP that contains a Joda DateTime:

public beanClass{
  pr         


        
相关标签:
1条回答
  • 2021-01-19 04:57

    You should use file messages.properites to declare specific information:

    typeMismatch.java.util.Date = Invalid date
    

    Of course you should provide information about this file in your spring-context.xml

      <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
         <property name="basename" value="/WEB-INF/config/messages"/>
         <property name="defaultEncoding" value="UTF-8"/>         
        </bean>
    
    0 讨论(0)
提交回复
热议问题