How to use Redirect in ModelAndView

后端 未结 2 1059
野的像风
野的像风 2020-12-11 06:12

I Want to redirect my url to http://localhost:8080/ClickBuy/product/details to http://localhost:8080/ClickBuy/home .

I have Define header.jsp and Include it

2条回答
  •  Happy的楠姐
    2020-12-11 06:34

    There are different ways to redirect but using Spring ModelView Object is simple

    @RequestMapping(value = "/redirecturl", method = RequestMethod.POST)
        public ModelAndView methodPost() {
                return new ModelAndView( "redirect:/login.html");
    
        }
    

提交回复
热议问题