NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
**1.跳转百度** ~~~ @RequestMapping("fun7") public String fun7(){ return "redirect:http://www.baidu.com"; } ~~~ **2.跳转内部jsp页面** ~~~ @RequestMapping("fun7") public String fun7(){ //webapp是根目录 return "redirect:/index.jsp"; } ~~~ 3.使用ServletApi跳转内部jsp页面 ~~~ @RequestMapping("fun8") public void fun8(HttpServletRequest request, HttpServletResponse response){ try{ response.sendRedirect(request.getContextPath()+"/index.jsp"); }catch(IOException e){ e.printStackTrace(); } } ~~~