Spring-Returning json with @ResponseBody when the Accept header is */* throws HttpMediaTypeNotAcceptableException

后端 未结 3 837
情深已故
情深已故 2021-01-07 02:00

I\'m using spring 3.0.0.

I have an endpoint that returns an object that I want to be serialized to JSON. When the request comes in with Accept: application/json, it

3条回答
  •  盖世英雄少女心
    2021-01-07 02:33

    Include these dependencies to your pom.xml

     
        org.codehaus.jackson
        jackson-core-asl
        1.9.3
     
    
     
        org.codehaus.jackson
        jackson-mapper-asl
        1.9.3
      
    

提交回复
热议问题