如何使用SPRING BeanNameViewResolver重定向到URL

时间:2016-07-10 12:30:11

标签: spring redirect model-view-controller

使用BeanNameViewResolver时是否可以重定向到Spring MVC控制器内的另一个URL? 也许在某种程度上只是逃避bean名称解析?

这显然只适用于UrlBasedViewResolver

public

1 个答案:

答案 0 :(得分:0)

找到答案

    @RequestMapping(value = "/**", method = RequestMethod.GET)
public View postPage(HttpServletRequest req, Map<String, Object> model){
    RedirectView redirectView = new RedirectView("http://localhost:9090/flowID");
    return redirectView;
}