企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
**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(); } } ~~~