`

WEB乱码解决方法

 
阅读更多

1.JSP页面设置

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

 

 

2.servlet类设置

doGet方法:

  request.setCharacterEncoding("UTF-8");
  response.setContentType("text/html;charset=UTF-8");

doPost方法:

  request.setCharacterEncoding("UTF-8");
  response.setContentType("text/html;charset=UTF-8");

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics