spring mvc action 跳转
returnString
@RequestMapping(params="action=delete")
publicStringdelete(@RequestParam("type")
inttype,@RequestParam("url")
Stringurl){
return"redirect:/console/visitorPolicyList.do?action=list&type=1";
}
ModelAndView
eturnNewModelAndView(newRedirectView(“xxx.jsp“));
或者returnNewModelAndView(newRedirectView(getSuccessView()));
//配制
SpringMvc默认的是forward方式(mvc框架都是这样),IE地址栏内的URL肯定不变了。用redirect方式倒是可以,在Controller里面returnnewModelAndView(newRedirectView(getSuccessView())).如果用InternalResourceViewResolver的话更简单一些,把view的名字加个“redirect:“前缀就行了(redirect:index.jsp),这样的好处是基于配置文件的。不过要传到页面上的对象怎么办?而且也暴露了view技术为jsp
相关推荐
zhangdy0 2020-05-31
方志朋 2019-12-14
JudeJoo 2019-11-18
neweastsun 2019-11-07
Julywhj 2019-11-07
boneix 2020-10-21
JudeJoo 2020-08-21
meleto 2020-08-15
haidaoxianzi 2020-07-04
小鱿鱼 2020-06-26
咻pur慢 2020-06-15
haidaoxianzi 2020-06-14
qingjiuquan 2020-06-07
qingjiuquan 2020-05-30
HappyHeng 2020-05-16
whbing 2020-04-17
whbing 2020-04-11
小鱿鱼 2020-03-20
mendeliangyang 2020-02-20