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");

 

相关文章:

  • 2021-07-08
  • 2022-12-23
  • 2021-10-04
  • 2021-04-21
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2021-10-08
  • 2022-12-23
  • 2021-05-16
相关资源
相似解决方案