您可能可以精确地执行正在执行的操作
org.springframework.http.converter.json.MappingJacksonHttpMessageConverter。由于它不是最终课程,因此您可以通过以下方式从该类派生您的转换器:
class MyCustomVndConverter extends MappingJacksonHttpMessageConverter{ public MyCustomVndConverter (){ super(MediaType.valueOf("application/vnd.myservice+json")); }}然后以这种方式注册您的转换器:
<mvc:annotation-driven> <mvc:message-converters register-defaults="true"> <bean /> </mvc:message-converters></mvc:annotation-driven>
它应该与这些更改一起使用



