Spring @ResponseBody Jackson JsonSerializer with JodaTime

后端 未结 5 873
我在风中等你
我在风中等你 2020-12-03 11:26

I have below Serializer for JodaTime handling:

public class JodaDateTimeJsonSerializer extends JsonSerializer {

    private static final Str         


        
5条回答
  •  情书的邮戳
    2020-12-03 11:39

    If you simply have the Jackson JARs on your classpath, and return a @ResponseBody, Spring will automatically convert the Model object to JSON. You don't need to annotate anything in the Model to get this to work.

提交回复
热议问题