Servletrequest.getRequestDispatcher(“url”) means the dispatch is relative to the current HTTP request.
Example code:
RequestDispatcher reqDispObj = request.getRequestDispatcher("/login.jsp");
getServletContext().getRequestDispatcher(“url”) means the dispatch is relative to the root of the ServletContext.
Example code:
RequestDispatcher reqDispObj = getServletContext().getRequestDispatcher("/testApp/login.jsp");
Leave a Reply