本文主要是介绍表单提交数据乱码(datatables提交中文查询处理),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
表单提交数据乱码(datatables提交中文查询处理)
String batch_no = new String(request.getParameter("batch_no").getBytes("ISO-8859-1"),"UTF-8");
备份代码:
@ResponseBody
@RequestMapping("/page")
public Object page(Integer start, Integer length, String areaId, HttpServletRequest request)throws UnsupportedEncodingException {String search = new String(request.getParameter("search[value]").getBytes("ISO-8859-1"), "UTF-8");Map<String, Object> paramMap = new HashMap<String, Object>(); // 业务条件查询参数if (SUtils.isNotEmpty(search)) {if ("上架".equals(search)) {paramMap.put("status", 0);} else if ("下架".equals(search)) {paramMap.put("status", 1);} else {paramMap.put("query", " LIKE '%" + search + "%' ");}}paramMap.put("areaId", areaId);return areaShopService.findPageMap(getPageRequest(start, length), paramMap);
}
这篇关于表单提交数据乱码(datatables提交中文查询处理)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!