卧槽,6。Tomcat访问html页面显示源码? 元凶text/explain //踩坑!!!不能用 servletResponse.setContentType("text/explain,否则访问html会看到源码,而不是渲染页面; charset=UTF-8");servletResponse.setContentType("text/html; charset=UTF-8");servletResponse.setCharacterEncoding("utf-8"); 效果如下: