一行代码解决tomcat输出中文到浏览器出现乱码问题! 不多逼逼直接上代码 resp.setContentType("text/html;charset=UTF-8");//设置resp(响应页面)页面为html格式,编码为utf-8