我用bootstrap-table,或者用axios向后台发出请求,回调是json数据。
用jQuery.ajax 或者在浏览器直接请求,获得是xml数据。为什么?
相关问题
- java.lang.IllegalArgumentException: Cannot set to
- Spring Data MongoDB - lazy access to some fields
- Declaring an explict object dependency in Spring
- Decoding body parameters with Spring
- Spring Integration - Inbound file endpoint. How to
相关文章
- java JDK动态代理和cglib动态代理最后获取的代理对象都为null的问题
- org.xml.sax.SAXParseException; lineNumber: 7; colu
- SpringMVC如何把File封装到Map中?
- Spring: controller inheritance using @Controller a
- How to load @Configuration classes from separate J
- Java spring framework - how to set content type?
- Java/Spring MVC: provide request context to child
- Spring 5 Web Reactive - Hot Publishing - How to us
因为你没在请求头重执行contenttype.就是要求服务端返回什么格式的数据.
contentType:"application/json;
好像要求你后台方法接受参数加上@RequestBody
ajax 参数 dataType:'json'。如果不加,springMVC默认是转xml,springboot默认转json。
@RequestMapping(value = "getList", consumes = "application/json", produces = "application/json")
@ResponseBody
public DataGridResult<UserInfo> GetList(@RequestBody User condition) {