孙卫琴精通hibernate没看过 

解决方案 »

  1.   


    java.io.CharConversionException: Not an ISO 8859-1 character: 以 
    就是编码问题了,"以"是中文,ISO 8859-1不行的,看看哪里改改编码,用utf-8
      

  2.   

    hello_jsp是用什么编码的?在myeclipse的话写个中文看看能不能保存
      

  3.   

    request.setCharacterEncoding
    <%@ page contentType=......%>
    我都用过了,没用
      

  4.   


    package mypack;import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;public class DBServlet extends HttpServlet {  public void init(ServletConfig config)
        throws ServletException {
        super.init(config);
      }  public void doGet(HttpServletRequest request,
        HttpServletResponse response)
        throws ServletException, IOException {    // If it is a get request forward to doPost()
        doPost(request, response);  }  public void doPost(HttpServletRequest request,
        HttpServletResponse response)
        throws ServletException, IOException {
           try{
                 response.setContentType("text/html;charset=UTF8");
                 new BusinessService().test(this.getServletContext(),response.getOutputStream());
           }catch(Exception e){e.printStackTrace();
    }
      }  public void destroy() {
      }
    }
      

  5.   

    <html locale="true">
      <head>
        <title>hello.jsp</title>
      </head>
      <body bgcolor="white">
         <jsp:forward page="DBServlet" />
      </body>
    </html>
    这个是hello。jsp的
      

  6.   

    建议:
    1. 只以英文字符模式进行传递;
    2. 如果英文有问题,应该是转码的问题;
    3. 执行单步跟踪,确认hibernate进行数据库插入前的sql没有问题;
      

  7.   

    我一直用的编码格式是gb2312或者GBK的