Spring MVC 4: “application/json” Content Type is not being set correctly

前端 未结 6 1685
旧巷少年郎
旧巷少年郎 2020-11-30 00:41

I have a controller mapped with the following annotation:

@RequestMapping(value = \"/json\", method = RequestMethod.GET, produces = \"application/json\")
@Re         


        
6条回答
  •  醉酒成梦
    2020-11-30 01:28

    I had the dependencies as specified @Greg post. I still faced the issue and could be able to resolve it by adding following additional jackson dependency:

    
        com.fasterxml.jackson.dataformat
        jackson-dataformat-xml
        2.7.4
    
    

提交回复
热议问题