摘要: 1、表单get方法提交参数乱码,由于默认的tomcat按照iso-8859-1对url进行编码所以要进行相应转换:
@首先在接受参数页面或者servlet设置request的编码方式例如:request.setCharacterEncoding("utf-8");
@对接受到的参数改变编码,和上面的characterencoding的编码相同,new String(request.getParameter("username").getBytes("iso-8859-1"),"utf-8");
阅读全文