@RequestMapping(value = "/getMgInsurancesByParams.do",produces="application/json;charset=UTF-8")
@ResponseBody
public String getMgInsurancesByParams() {
return "abc";
}
![图片描述][1]
@RequestMapping(value = "/getMgInsurancesByParams.do",produces="application/json;charset=UTF-8")
@ResponseBody
public String getMgInsurancesByParams() {
return "abc";
}
![图片描述][1]
直接上代码了。
@RequestMapping(value = "/test4")
public
@ResponseBody
String downLoad(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
httpServletResponse.setContentType("application/json");
httpServletResponse.setHeader("Content-disposition", "attachment; filename=" + "测试json数据");
return "66";
}
1 回答2.6k 阅读✓ 已解决
3 回答2k 阅读
2 回答1.7k 阅读
2 回答1.3k 阅读
1 回答807 阅读✓ 已解决
1 回答1.2k 阅读
设置header
Content-Disposition: attachment; filename=下载文件名