欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

This XML file does not appear to have any style information associated with it. The document tree is

程序员文章站 2024-03-14 16:57:22
...

服务端返回的数据 在页面上通过xml显示

This XML file does not appear to have any style information associated with it. The document tree is

 转为json显示

//注意producess 的 包
import org.springframework.http.MediaType;
 @RequestMapping(value = "/find",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)

在RequestMapping注解后 加一个 produces属性即可

注:该属性在 org.springframework.http 包下