孙卫琴精通hibernate没看过
解决方案 »
- 小妹求救:诡异的hibernate问题,插入数据时:null id in XXX entry 在线等~~~~
- 使用java写一个操作硬盘上文件的程序
- weblogic下与webphere下连接关闭与获取的问题
- SOS...JSP问题!我没分~有拉一定给你!
- java 与Mysql
- 一个ibatis的问题
- 请问如何写hibernate自定义id生成器?
- 请问如在一行文字 ?中获的想要字符串????????
- JVM崩溃,求支招!!!!!!!!!!!!!!!!!!!!!!!!
- 求助:通过反射判断某个字段是否为空
- ssh框架集成这出的严重问题,大哥大姐来帮忙看下把
- struts 2 怎样判断数据库字段是否为空
java.io.CharConversionException: Not an ISO 8859-1 character: 以
就是编码问题了,"以"是中文,ISO 8859-1不行的,看看哪里改改编码,用utf-8
<%@ page contentType=......%>
我都用过了,没用
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() {
}
}
<head>
<title>hello.jsp</title>
</head>
<body bgcolor="white">
<jsp:forward page="DBServlet" />
</body>
</html>
这个是hello。jsp的
1. 只以英文字符模式进行传递;
2. 如果英文有问题,应该是转码的问题;
3. 执行单步跟踪,确认hibernate进行数据库插入前的sql没有问题;