java使用PrintWriter向前端打印示例
解决方法:
response.setCharacterEncoding("utf-8");
response.setContentType("text/html;charset=utf-8");
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException var4) {
throw new RuntimeException("输出json错误");
}
if (msgObj instanceof String) {
out.write((String)msgObj);
} else {
out.write(JSON.toJSONString(msgObj));
}
out.flush();
out.close();
本文地址:http://www.yayihouse.com/yayishuwu/chapter/1228
向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti