乱码请在你的jsp页中加入:
<%@ page contentType="text/html; charSet=GBK"%>

解决方案 »

  1.   

    向数据库中写也出错、insert value too large for column
    的原因应该是:你的字段定义的长度不够,记住:一个中文应该是两个长度。
      

  2.   

    乱码如果没有解决还可以这样:
    System.out.println(new String(request.getParameter(onevalue).getBytes("ISO8859_1"),"GBK"));
      

  3.   

    同意:
    System.out.println(new String(request.getParameter(onevalue).getBytes("ISO8859_1"),"GBK"));
    因为java里跑的是iso8859_1的编码!而我们显示一般是用GBK
      

  4.   

    str=new String(str.getBytes("ISO8859_1"), "GBK");
    常用的有4种字符集"UTF-8","GBK","GB2312","ISO8859_1",16种排列方式
    不行的话就一个一个试
      

  5.   

    重新编译servlet,命令写为:javac -encoding ISO8859_1 file.java
    其中file.java是你的servlet文件。