2025-03-31 02:23:22
2025-03-31 00:17:03
2025-03-31 01:40:14
public static void returnJson(HttpServletResponse response, CharSequence text)
throws Exception {
response.setContentType("application/json;charset=UTF-8");
response.setHeader("Cache-Control", "no-store");
response.setHeader("Pragrma", "no-cache");
response.setDateHeader("Expires", 0);
response.getWriter().write(text.toString());
}
其中text这个是JSONObject或者Map
response.setContentType("application/json;charset=UTF-8");这个表示以json格式返回
前台需要eval接收到的数据,就是json格式了
2025-03-31 01:07:56
2025-03-31 02:59:18