Java backend redirection implementation

Artificial intelligence, zero-based entry! http://www.captainbed.net/inner

Java redirect backstage with parameters to redirect to another interface 

If the redirected interface is to pass parameters, use the following method to achieve:

[1] The target interface to be redirected to:

// @ModelAttribute 注解接收
@RequestMapping("work")
public String workOrderQuickSearch(Model model, @ModelAttribute("msg") String msg) {
    
}

[2] Now we need to call the above interface:

// 声明 RedirectAttributes
public String handleServiceOrder(RedirectAttributes attributes) {
    // 重定向,传参
    attributes.addFlashAttribute("msg",msg);
    return "redirect:work";
}

 

Guess you like

Origin blog.csdn.net/qq_35860138/article/details/104243989