老应用链接替换到新链接

@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);
}

  

posted @ 2019-12-03 19:56  dark_passion  阅读(232)  评论(0编辑  收藏  举报