您的位置:首页 > 编程语言 > Java开发

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

2014-05-11 15:30 423 查看
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: