使用HttpservletResponse输出数据时,一定要设置编码字符集,否则出现乱码或者为空
如:
resp.setContentType("text/html;charset=utf-8");//设置编码
如果是在json中,使用HttpservletResponse输出数据,这样设置:
resp.setContentType("application/json;charset=utf-8");//设置编码
使用HttpservletResponse输出数据时,一定要设置编码字符集,否则出现乱码或者为空
如:
resp.setContentType("text/html;charset=utf-8");//设置编码
如果是在json中,使用HttpservletResponse输出数据,这样设置:
resp.setContentType("application/json;charset=utf-8");//设置编码