java查询语句包含中文获取不到数据

在查询数据的时候查询语句中包含中文就都查询不到数据,传入的中文参数并没有乱码

解决方法:数据库连接url后面加上?characterEncoding=UTF-8

 

js前台到后台中文传值乱码问题

后台加入 :  request.setCharacterEncoding("utf-8")  

html加 :

<%@ page language="java" contentType="text/html; charset=utf-8"    

 pageEncoding="utf-8"%>    

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"

posted @ 2017-05-08 15:52  sunny^*^  阅读(249)  评论(0编辑  收藏  举报