SSH框架中Controller接收web前端得中文字符乱码问题解决

来源:互联网 发布:变老软件电脑版 编辑:程序博客网 时间:2024/06/12 01:41

前端的汉字在controller中显示乱码,这里只提供一种中文乱码解决方案,供大家参考。具体代码如下:

public JSONReturn findschool(@RequestParam String pro,@RequestParam String city,HttpServletRequest request) throws UnsupportedEncodingException {String pro1 =new String(request.getParameter("pro").getBytes("ISO8859-1"), "UTF-8");String city1 =new String(request.getParameter("city").getBytes("ISO8859-1"), "UTF-8");return userService.findschool(pro1,city1);}

阅读全文
0 0