标签:
<a href="<%=request.getContextPath() %>/search?username=<%=name %>" title="查看个人资料" target="_blank">
String notUsername = req.getParameter("username"); String username = new String(notUsername.getBytes("ISO-8859-1"),"UTF-8");
的方式,把接受过来汉字通过UTF-8的编码方式进行解码,这样才能保证得到的文字不出现乱码。
String username = req.getParameter("username");
String username = req.getParameter("username");
String notUsername = req.getParameter("username"); String username = new String(notUsername.getBytes("ISO-8859-1"),"UTF-8");
标签:
原文地址:http://www.cnblogs.com/hourui/p/doGet-doPost.html