skip to main |
skip to sidebar
Home
»
Servlets
»
Difference between ServletRequest.getRequestDispatcher and ServletContext.getRequestDispatcher
Posted by Unknown
Thursday, 14 November 2013
0 comments
- request.getRequestDispatcher(“url”) means the dispatch is relative to the current HTTP request.
Example code: RequestDispatcher reqDispObj = request.getRequestDispatcher("/home.jsp");
- getServletContext().getRequestDispatcher(“url”) means the dispatch is relative to the root of the ServletContext.
Example code:RequestDispatcher reqDispObj = getServletContext().getRequestDispatcher("/ContextRoot/home.jsp");
0 comments:
Post a Comment