Spring 3.0 forwarding request to different controller

后端 未结 3 433
广开言路
广开言路 2021-01-31 17:44

What is the proper way to forward a request in spring to a different controller?

@RequestMapping({\"/someurl\"})
public ModelAndView execute(Model model) {
    i         


        
3条回答
  •  难免孤独
    2021-01-31 17:53

    You can use Spring RedirectView to dispatch request from one controller to other controller. It will be by default Request type "GET"

    RedirectView redirectView = new RedirectView("/controllerRequestMapping/methodmapping.do", true);
    

提交回复
热议问题