小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

java后臺(tái)重定向post傳參及接受重定向post傳參

 一本正經(jīng)地胡鬧 2019-08-06

項(xiàng)目中碰到的問題是,我在controller中有重定向傳參到另外一個(gè)controller,但是接收到的值是亂碼    ps:我傳的參數(shù)是漢字

請教了我們的項(xiàng)目經(jīng)理,說是那個(gè)重定向傳參是get方式的請求傳參:示例代碼

復(fù)制代碼
return "redirect:/RepaieInfo/goDetail?companyId="+companyId
                        +"&baseNo="+baseNo
                        +"&doorId="+doorId
                        +"&account="+creater
                        +"&id="+idRepair
                        +"&modifier="+modifier
                        +"&workOrderStatus="+"1";
復(fù)制代碼

后面我改成了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)行正常的邏輯

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多