在spring mvc中实现在Controller中进行页面跳转有两种方式
1.
2.
1.
public ModelAndView login(HttpServletResponse response, String id) {
response.sendRedirect("index.do="+id);
return null;
}
2.
public ModelAndView login(HttpServletResponse response, String id) {
return new ModelAndView("redirect:index.do="+id);
}