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

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

猜你喜欢

转载自blog.csdn.net/qq_20372833/article/details/78749511