spring mvc redirect 传递参数 和接收

 
@RequestMapping(value = "/front/traceInfo", method = RequestMethod.GET)
    public String getTraceInfo(HttpServletRequest request,
                               RedirectAttributes attributes,
                               @RequestParam(value = "code") String enterpriseCode,
                               @RequestParam(value = "traceCode") String traceCode,
                               @RequestParam(value = "referral", required = false) String referral,
                               ) {
            attributes.addFlashAttribute("code", enterpriseCode);
            attributes.addFlashAttribute("traceCode", traceCode);
            attributes.addFlashAttribute("referral", referral);
            return "redirect:/front/mobile/traceInfo";
        }
}
 @RequestMapping(value = "/front/mobile/traceInfo", method = RequestMethod.GET)
    public String getTraceIntroduceForModel(@ModelAttribute(name = "code") String enterpriseCode,
                                            @ModelAttribute(name = "traceCode") String traceCode,
                                            @ModelAttribute(name = "referral") String referral,
                                            HttpServletRequest request,
                                            HttpServletResponse response,
                                            HttpSession session,
                                            ModelMap modelMap) {
        //todo ...
}

 

 

 

 

 

 

 

你可能感兴趣的:(spring mvc redirect 传递参数 和接收)