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

前端 未结 6 1686
旧巷少年郎
旧巷少年郎 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:09

    When I upgraded to Spring 4 I needed to update the jackson dependencies as follows:

        
            com.fasterxml.jackson.core
            jackson-core
            2.5.1
        
        
            com.fasterxml.jackson.core
            jackson-databind
            2.5.1
        
        
            com.fasterxml.jackson.core
            jackson-annotations
            2.5.1
                
    

提交回复
热议问题