springmvc怎么跳转页面
2个回答
展开全部
spring mvc实现Controller进行页面跳转两种式
1.Java代码
public ModelAndView login(HttpServletResponse response, String id) {
response.sendRedirect("index.do="+id);
return null;
}
public ModelAndView login(HttpServletResponse response, String id) {
response.sendRedirect("index.do="+id);
return null;
}
2.Java代码
public ModelAndView login(HttpServletResponse response, String id) {
return new ModelAndView("redirect:index.do="+id);
}
public ModelAndView login(HttpServletResponse response, String id) {
return new ModelAndView("redirect:index.do="+id);
}
return new ModelAndView("redirect:" + downloadUrl);
1.Java代码
public ModelAndView login(HttpServletResponse response, String id) {
response.sendRedirect("index.do="+id);
return null;
}
public ModelAndView login(HttpServletResponse response, String id) {
response.sendRedirect("index.do="+id);
return null;
}
2.Java代码
public ModelAndView login(HttpServletResponse response, String id) {
return new ModelAndView("redirect:index.do="+id);
}
public ModelAndView login(HttpServletResponse response, String id) {
return new ModelAndView("redirect:index.do="+id);
}
return new ModelAndView("redirect:" + downloadUrl);
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询