Filter 过滤器

版本2.5

在web.xml中<url-pattern>/*</url-pattern>

在Filter中 doFilter(.....  )方法下写代码

request.setCharacterEncoding("UTF-8");

response.setContentType("text/html");

response.setCharacterEncoding("UTF-8");

过滤器才生效

原文地址:https://www.cnblogs.com/hanruyue/p/6025429.html