解决ie打开url返回json/map自动下载
2016-08-05 14:50
429 查看
去掉responsebody改为返回ResponseEntity
@RequestMapping("/map")
public ResponseEntity<Map<String,Object>> ds(){
Map<String,Object> map = new HashMap<String,Object>();
map.put("1", "2");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.TEXT_PLAIN);
return new ResponseEntity<Map<String, Object>>(map, headers, HttpStatus.OK);
}
@RequestMapping("/map")
public ResponseEntity<Map<String,Object>> ds(){
Map<String,Object> map = new HashMap<String,Object>();
map.put("1", "2");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.TEXT_PLAIN);
return new ResponseEntity<Map<String, Object>>(map, headers, HttpStatus.OK);
}
相关文章推荐
- 关于JS原型链
- ajax同步开发——json+对应的处理方式直接贴上被我滥用的代码标本吧:
- D3.js学习总结
- 用面向对象的编程思想去写js
- 前后台json数据绑定——way.JS
- [leetcode]304. Range Sum Query 2D - Immutable -- JavaScript 代码
- 轻松理解javascript中的闭包
- JavaScript事件概览
- 当获得json格式的字符串时,如何用Alibaba的json包来解析
- JavaScript笔记:引用类型
- JS中function()使用方法
- JS图表工具 ---- Highcharts
- js 对象转数组
- JavaScript学习总结(一)——JavaScript基础
- fireDebug与js加密格式化工具正则表达式工具下载
- HTML5 respond.js 解决IE6~8的响应式布局问题
- js获取select标签选中的值
- 原生Js回到顶部效果
- 【js 方法】js 页面刷新location.reload和location.replace的区别 【转】
- Json的反序列化 .net Newtonsoft.Json