spring mvc action 跳转

return String
@RequestMapping(params = "action=delete")
public String delete(@RequestParam("type")
int type, @RequestParam("url")
String url) {
return "redirect:/console/visitorPolicyList.do?action=list&type=1";
}

ModelAndView
eturn New ModelAndView(new RedirectView(“xxx.jsp“));
或者 return New ModelAndView(new RedirectView(getSuccessView()));

// 配制
SpringMvc默认的是forward方式(mvc框架都是这样),IE地址栏内的URL肯定不变了。用redirect方式倒是可以,在 Controller里面return new ModelAndView(new RedirectView(getSuccessView())). 如果用InternalResourceViewResolver的话更简单一些,把view的名字加个“redirect:“前缀就行了(redirect:index.jsp),这样的好处是基于配置文件的。 不过要传到页面上的对象怎么办?而且也暴露了view技术为jsp

你可能感兴趣的:(MVC,Spring,JSP,IE,框架)