【发布时间】:2014-12-12 07:32:20
【问题描述】:
在 spring 控制器类中编写代码时,如何在新窗口或选项卡中打开 URL。 下面是代码:
@RequestMapping(value = "/showPage", method = RequestMethod.GET)
public ModelAndView openDataLink(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception {
//logic to get or construct the URL
return new ModelAndView(new RedirectView("http://www.google.com"));
}
当我访问控制器时,从我的应用程序中,google.com 会在我访问应用程序的同一窗口中打开。从我的应用程序访问控制器时,如何使 google.com 在新窗口或标签中打开。请提出建议。
【问题讨论】:
标签: java html spring-mvc