老应用链接替换到新链接

@RequestMapping("/myContext/**")
public void redirect(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String requestUrl = request.getRequestURI();
        log.info("request.getRequestURI(): old "+requestUrl);
        requestUrl = requestUrl.replace("myContext","myContext2"); 
     log.info("request.getRequestURI(): new " + requestUrl); request.getRequestDispatcher(requestUrl).forward(request,response);
}

  

上一篇:90. 子集 II


下一篇:Maven学习笔记(3) --mvn archetype:generate 说明