关于大家说的显示中文的问题我是这样解决的,改成doPost请求,前台两次编码转换
var url = "search?keyword="+encodeURI(encodeURI(content.value));
后台也需要转换一次
// request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
String keyword = request.getParameter("keyword");
keyword =URLDecoder.decode(keyword, "UTF-8");
var url = "search?keyword="+encodeURI(encodeURI(content.value));
后台也需要转换一次
// request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
String keyword = request.getParameter("keyword");
keyword =URLDecoder.decode(keyword, "UTF-8");
2016-12-13