表单代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head> 
<body>
<form method="get" action="../servlet/GuestBook">
<div align="center">
<center><p>您的姓名:<input type="text" name="name" size="30"><br>
您的E-MAIL<input type="text" name ="mail" size=30"></p>
</center></div>
<div align  ="center">
<center><p>
<textarea name="content" rows="5" name="main" cols="30">
</textarea>
</p></center>
</div>
<div align  ="center">
<center>
<p>
  <input type="submit" value="确定"  name="B1" >
  <input type="reset" value="取消" name="B2">
  <input type="button" value="浏览留言" name ="B3" onclick="window.location.href='../servlet/Watch'">
      </p>
</center></div>
</form>
</body>
</html>GuestBook:import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.net.URL;
import java.sql.*;
public class GuestBook extends HttpServlet
{
Connection con;
public void init(ServletConfig conf) throws ServletException
{
   super.init();//调用父类的初始化函数
   String l="jdbc:odbc:wl";
   try
   {
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      con=DriverManager.getConnection(l,"sa","");
      }
       catch(Exception e )
      {
      //没有进行处理
      }
       }
public void doGet(HttpServletRequest request ,HttpServletResponse response)
    throws IOException,ServletException
{
String name=request.getParameter("name");
String email=request.getParameter("email");
String content=request.getParameter("content");
java.util.Date to_day = new java.util.Date();
String date_string=to_day.toString();
response.setContentType("text/html;charset=gb2312");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head>");        try
        {
        Statement stmt =con.createStatement();
        String sql="insert into stud values('"+name+"','"+email+"','"+content+"','"+date_string+"')";
        stmt.executeUpdate(sql);
  con.close();
  out.println("<title>您已经成功添加完信息</title>");
           out.println("</head>");
           out.println("<body>");
           out.println("<h1>您的意见已经成功输入数据中!谢谢您的支持!</h1>");
}
catch(SQLException ex)
     {
           while(ex!=null)
           {
           out.println("数据库异常被捕获了");
           out.println(ex.getSQLState());
           out.println(ex.getMessage());
           out.println(ex.getErrorCode());
           ex=ex.getNextException();
       }
      }
       out.println("</body>");    
       out.println("</html>");
   }
}上例中数字接受正常,中文接受的全是????