tomcat启动没有问题的,但是过1-2天就会乱码了;tomcat重启就好了,再过1-2天又乱码...无限递归。
代码是这样的:
public void doPost(HttpServletRequest req, HttpServletResponse resp)...
{
// 这边解决跨域
resp.setHeader("Access-Control-Allow-Origin", "*");
resp.setHeader("Access-Control-Allow-Methods", "POST");
req.setCharacterEncoding("utf-8");
resp.setContentType("text/html;charset=utf-8");
PrintWriter out = resp.getWriter();
String bookName = req.getParameter("book");
// 这边是把接收的参数写到数据库假装![图片说明](https://img-ask.csdn.net/upload/201705/09/1494289706_46397.png)LOG
SQLHelper.insertUpdate("INSERT INTO `temp` (`name`, `fileName`) VALUES ('" +
bookName + "', 'SearchBook.java')");
}