servlet参数编码配置

1 //读取web.xml中的编码配置
2         ServletContext context = this.getServletContext();
3         String encode = context.getInitParameter("encode");
4 
5         //请求参数编码设置
6         request.setCharacterEncoding(encode);
7         //响应输出编码配置
8         response.setContentType("text/html;charset=utf-8");
原文地址:https://www.cnblogs.com/pxffly/p/7462773.html