如题,A项目带参数发送请求到B项目。刚开始还好,但是发觉 参数带中文 就出现问题了,变成了??
解决方法:发送中文参数前先做处理
request.getSession().removeAttribute("pass");
request.getSession().removeAttribute("type");
//设置编码格式不然会乱码??
username = URLEncoder.encode(username,"UTF-8");
address = URLEncoder.encode(address,"UTF-8");
return "redirect:"+resource.getString("business.type.twoURL")+"?price="+price+"&u="+ username+"&d="+address+"&t="+phone;
另一个项目接收,就是普通的接收
String userName =request.getParameter("u");
String address = request.getParameter("d");
String phoneNum = request.getParameter("t");