SpringMVC中Controller跳轉到另一個Controller方法


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);


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM