jsp页面第一行
<%@ page language="java" import="java.io.*" contentType="text/html; charset=GB2312"%>

解决方案 »

  1.   

    <%@ page language="java" import="java.io.*" contentType="text/html; charset=GB2312"%>
    这一句在提交表单所在页的开头也需要加上。
      

  2.   

    <%@ page language="java" contentType="text/html; charset=GB2312"%>
    加到页面中去
      

  3.   

    jsp页面第一行
    <%@ page contentType="text/html; charset=GB2312" %>
      

  4.   

    我用的Apache Tomcat 5.0.12般+jdk1.4.05
    没有看过中文乱码!!
    建议你升级
    <%@ page contentType="text/html;  charset=gb2312"%>

    <%  request.setCharacterEncoding("gb2312");%>
      

  5.   


        public String toChinese(String str){
        if(str==null){
        str  ="" ;
        }
        else{
            try {
           str = new String(str.getBytes("iso-8859-1"),"gb2312") ;
            }
            catch (Exception ex) {
            }
        }
        return str ;
     }
      

  6.   

    String s= new String(request.getParameter("name").getBytes.("8859_1"));