SpringMVC中Controller跳转到另一个Controller方法

来源:互联网 发布:淘宝卖家半个月不发货 编辑:程序博客网 时间:2024/05/28 04:54

1、直接Redirect后加Controller/Action

Response.Redirect("/User/Edit");

// returnRedirect("/User/Edit");

returnRedirectToAction("about","Home");

Response.Redirect("/User/Edit");

2、直接return后加Controller/Action

return Redirect("/User/Edit");

3、RedirectToAction方法,直接跳到一个action

return RedirectToAction("edit");

4、跳转的页并不在该Controller中

return RedirectToAction("about","Home");

5. redirect跳转

String url = "redirect:/test.do";

mav = new ModelAndView(url);

原创粉丝点击