post提交到controller控制器参数乱码问题

原文地址为: post提交到controller控制器参数乱码问题

       springMVC中,用js进行post提交到后台控制器controller的方法中,方法接收到字符串乱码。原因是在进行post提交时,会进行URL编码,也就是通过对应编码解码即可解决:

String strUri = URLDecoder.decode(strUri,"utf-8");

       编码的话,则是

String strUri = URLEncoder.encode(strUri,"utf-8");


转载请注明本文地址: post提交到controller控制器参数乱码问题

猜你喜欢

转载自blog.csdn.net/wcqlwyt/article/details/80923690