在网上找了很多资料才找到解决的方法,通过URL传递命名参数,后台接收的却是乱码解决方法如下:

方法:将接收的参数重新编码

@RequestMapping(value="/handle")
public String handle81(@RequestParam("userName") String userName){         
    userName=new String(userName.getBytes("ISO-8859-1"), "UTF-8")
    modelMap.put("userName", userName);
    return "/user/showUser";
}

 

相关文章:

  • 2021-11-17
  • 2021-04-26
  • 2021-12-25
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2021-11-03
  • 2021-09-17
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-01
相关资源
相似解决方案