使用java.net.URLEncoder.encode()可以对要传递的中文进行编码
encode:
word = java.net.URLEncoder.encode("中文字符","GB2312");
decode:
//request.setCharacterEncoding("GBK");
String str=request.getParameter("word");
str=java.net.URLDecoder.decode(str,"GB2312");
str=new String(str.getBytes("ISO-8859-1"));