* 对于get请求 参数追加到地址栏后,会使用utf-8 编码,服务器接受到请求之后,使用iso-8859-1 解码,所以出现乱码 ��
* 对于post请求 参数放在请求体中,服务器获取请求体的时候会使用iso-8859-1解码 解决方法 request.setCharacterEncoding("utf-8");
解决方法:
request.setCharacterEncoding("utf-8");//post中文乱码问题
new String((request.getParameter("username").getBytes("iso-8859-1")),"utf-8");//get中文乱码问题