String jsonRedirect = "{code:-101, msg:'没操作权限'}";//这里有错
response.setContentType("application/json; charset=utf-8");
response.getWriter().println(jsonRedirect
);
解决:改用双引号
String jsonRedirect = "{\"code\":-101, \"msg\":\"没操作权限\"}";
String jsonRedirect = "{code:-101, msg:'没操作权限'}";//这里有错
response.setContentType("application/json; charset=utf-8");
response.getWriter().println(jsonRedirect
);
解决:改用双引号
String jsonRedirect = "{\"code\":-101, \"msg\":\"没操作权限\"}";