Spring 3.1 JSON date format

后端 未结 3 1691
挽巷
挽巷 2020-11-30 00:45

I am using annotated Spring 3.1 MVC code (spring-mvc) and when i send date object through the @RequestBody the date is showing up as numeric. This is my controller

3条回答
  •  忘掉有多难
    2020-11-30 01:04

    Here is a more standard way to configure this, using ISO8601 dates, which is what I would recommend for your API.

    
    
        
            
                
            
        
    
    
    
    
        
            
                
            
        
    
    

    Here is additional documentation:

    • Jackson FAQ
    • Spring's Jackson2ObjectMapperFactoryBean

提交回复
热议问题