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

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

return "redirect:/RepaieInfo/goDetail?companyId="+companyId
                        +"&baseNo="+baseNo
                        +"&doorId="+doorId
                        +"&account="+creater
                        +"&>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){

后续在进行正常的逻辑

相关文章:

  • 2021-07-25
  • 2021-08-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
  • 2021-06-19
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2021-11-29
  • 2021-09-17
  • 2021-06-15
  • 2022-12-23
相关资源
相似解决方案