Posts Tagged Servlet

Difference between ServletRequest.getRequestDispatcher and ServletContext.getRequestDispatcher

October 26, 2011
Difference between ServletRequest.getRequestDispatcher and ServletContext.getRequestDispatcher

If you use ServletRequest.getRequestDispatcher: you can use absolute path like “/index.jsp“, which forwards request to “http://www.myapp.com/index.jsp” from the request received directory or you can use relative path like “index.jsp”, which forwards request to “index.jsp” which is relative to the request received servlet. For example, if you receive your request on “http://www.myapp.com/mymodule/”, RequestDispatcher requestDispatcher = request.getRequestDispatcher(“index.jsp”); [...]

 

If you have a Tip, Comment, Article or anything you want to share, please send it to: i@poisure.com