Your name is:
<%out.println(new String(request.getParameter("name").getBytes("iso-8859-1"),"gb2312"));%>
Your email is:
<%out.println(new String(request.getParameter("name").getBytes("iso-8859-1"),"gb2312"));%>
</BODY>
试一试

解决方案 »

  1.   

    首先谢谢,但是
    那上面的中文:"姓名","电子邮箱"也是乱码啊
    那凡是有中文的地方都要这样转换起不是太麻烦了啊
    有没有更好的办法,让Tomcat能识别中文~
    在线等~~~~~~~~~~
      

  2.   

    leng_qinjie(永远珍惜) 
    你说的方法很好用~
    那上面的中文:"姓名","电子邮箱"也是乱码啊
    那凡是有中文的地方都要这样转换起不是太麻烦了啊
    有没有更好的办法,让Tomcat能识别中文~
    在线等~~~~~~~~~~
      

  3.   

    <%@ page contentType="text/html; charset=gb2312" language="java" %>
    这行加到页面顶部
    代码开头加上request.setCharactorEncoding("GB2312");
      

  4.   

    加上这句话: <%request.setCharecterEncoding("GBK");%>