|
項(xiàng)目中碰到的問題是,我在controller中有重定向傳參到另外一個(gè)controller,但是接收到的值是亂碼 ps:我傳的參數(shù)是漢字 請教了我們的項(xiàng)目經(jīng)理,說是那個(gè)重定向傳參是get方式的請求傳參:示例代碼 return "redirect:/RepaieInfo/goDetail?companyId="+companyId
+"&baseNo="+baseNo
+"&doorId="+doorId
+"&account="+creater
+"&id="+idRepair
+"&modifier="+modifier
+"&workOrderStatus="+"1";
后面我改成了post傳參: 這個(gè)是重定向post傳參; public String add(Map<String, Object> map, RedirectAttributes attributes, //將有漢字得參數(shù),以post的方式傳過去 attributes.addFlashAttribute("descContentV",descContentV); 第二個(gè)controller 是要接受我第一個(gè)controller傳過來的參數(shù) @RequestMapping(value = "/goDetail")
public String goDetail(HttpServletRequest httpRequest,
@ModelAttribute("descContentV") String descContentV, //接收第一個(gè)controller重定向傳過來的參數(shù)(post)
ModelMap model){
后續(xù)在進(jìn)行正常的邏輯 |
|
|