Spring MVC 415 Unsupported Media Type

前端 未结 7 1204
再見小時候
再見小時候 2020-11-28 13:01

I am using Spring 3.2 and try to use an ajax post request to submit an array of json objects. If this is relevant, I escaped all special characters.

I am getting an

相关标签:
7条回答
  • 2020-11-28 13:41

    You will need to add jackson and jackson-databind to the classpath. Spring will pick it up using it's MappingJacksonHttpMessageConverter

    MappingJacksonHttpMessageConverter

    An HttpMessageConverter implementation that can read and write JSON using Jackson's ObjectMapper. JSON mapping can be customized as needed through the use of Jackson's provided annotations. When further control is needed, a custom ObjectMapper can be injected through the ObjectMapper property for cases where custom JSON serializers/deserializers need to be provided for specific types. By default this converter supports (application/json).

    0 讨论(0)
提交回复
热议问题