如题:
代码如下 Applet端!
urlString = servletUrl + "?action=" + action + "&name=" + "中文");
URL url = new URL(urlString);//此处打印仍然保持中文
URLConnection urlconnection = url.openConnection();
brd = new BufferedReader(new InputStreamReader urlconnection.getInputStream(), "GBK"));//可以正常接收中文!Servlet接收!
public void service (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
  String name = req.getParameter("name");
  log("Name = " + name);//现实为“????”
}请不吝赐教~谢谢!

解决方案 »

  1.   

    urlString = servletUrl + "?action=" + action + "&name=" + java.net.URLEncoder.encode("中文","UTF-8");servlet:
     String name = req.getParameter("name");
      log("Name = " + java.net.URLDecoder(name."utf-8"));//现实为“????”
      

  2.   

    如果不行,urlString 中文2次encode,然后servlet端一次decode
      

  3.   

    谢谢各位,最后在Tomcat中,用过滤器解决了。