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

时间:2014-05-11 18:15:16   收藏:0   阅读:662

1、直接Redirect后加 Controller/Action

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

return Redirect("/User/Edit");  

return RedirectToAction("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";

ModelAndView mav = new ModelAndView(url);

SpringMVC中Controller跳转到另一个Controller方法,布布扣,bubuko.com

原文:http://www.cnblogs.com/michaelShao/p/3721835.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!