/*接收请求*/
String username = request.getParameter("username");
String password = request.getParameter("password");
/*转码为正常UTF-8编码*/
username = new String(username.getBytes("iso8859-1"),"UTF-8");
password = new String(password.getBytes("iso8859-1"),"UTF-8");
/*从URL转码为正常格式*/
username = URLDecoder.decode(username, "UTF-8");
password = URLDecoder.decode(password, "UTF-8");
/*返回响应 (省略判断)*/
out.print("你好" + username + " 欢迎登陆");


被折叠的 条评论
为什么被折叠?



