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

来源:互联网 发布:mate8自带软件 编辑:程序博客网 时间:2024/05/20 12:24
  1. 1、直接Redirect后加 Controller/Action
  2. Response.Redirect("/User/Edit");
  3. // return Redirect("/User/Edit");
  4. return RedirectToAction("about","Home");
  5. Response.Redirect("/User/Edit");
  6. 2、直接return后加 Controller/Action
  7. return Redirect("/User/Edit");
  8. 3、RedirectToAction方法,直接跳到一个action
  9. return RedirectToAction("edit");
  10. 4、跳转的页并不在该Controller中
  11. return RedirectToAction("about","Home");
  12. 5. redirect跳转
  13. String url = "redirect:/test.do";

mav = new ModelAndView(url);

原创粉丝点击