打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
java后台重定向post传参及接受重定向post传参

项目中碰到的问题是,我在controller中有重定向传参到另外一个controller,但是接收到的值是乱码    ps:我传的参数是汉字

请教了我们的项目经理,说是那个重定向传参是get方式的请求传参:示例代码

return "redirect:/RepaieInfo/goDetail?companyId="+companyId                        +"&baseNo="+baseNo                        +"&doorId="+doorId                        +"&account="+creater                        +"&id="+idRepair                        +"&modifier="+modifier                        +"&workOrderStatus="+"1";

后面我改成了post传参: 这个是重定向post传参;

public String add(Map<String, Object> map, RedirectAttributes attributes,//将有汉字得参数,以post的方式传过去attributes.addFlashAttribute("descContentV",descContentV);

第二个controller 是要接受我第一个controller传过来的参数

@RequestMapping(value = "/goDetail")    public String goDetail(HttpServletRequest httpRequest,            @ModelAttribute("descContentV") String descContentV, //接收第一个controller重定向传过来的参数(post)            ModelMap model){

后续在进行正常的逻辑

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Spring3 MVC (二)----注解基本配置及@Controller和@Reques...
基于Spring MVC的Web应用开发(5) - Redirect
spring mvc controller间跳转 重定向 传参
ASP.Net MVC Action重定向跳出Controller和Area
java
mvc基础系列说谈(3)——controller与action
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服