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