51,411
社区成员
发帖
与我相关
我的任务
分享
所以我在需要返回json格式的方法,加上了这个。
之前试了在方法上直接用 produces = MediaType.APPLICATION_XML_VALUE)
会报错 :No converter for [***********] with preset Content-Type 'null'
目前还不知道为什么
No converter for [*********] with preset Content-Type 'null' @RequestMapping(path = "myProduces",produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody
public MyData returnXmlValue(){
return getData();
}