前端的汉字在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);
}