标签:throw public response util content mvc servlet 对象 oid
单独json化一个对象,压缩为null的字段
@RequestMapping("/toDoListApproval")
public void toDoListApproval(String id, HttpServletResponse response) throws Exception {
Object responseResult = xxxService.getById(id);
response.setHeader("Content-Type","application/json;charset=UTF-8");
ServletOutputStream out = response.getOutputStream();
IOUtils.write(JSON.toJSONString(responseResult).getBytes("UTF-8"),out);
out.flush();
}
标签:throw public response util content mvc servlet 对象 oid
原文地址:https://www.cnblogs.com/TaranZhu/p/14831142.html