File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Difference between getRequestDispatcher() from ServletContext and HttpServletRequest Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Difference between getRequestDispatcher() from ServletContext and HttpServletRequest" Watch "Difference between getRequestDispatcher() from ServletContext and HttpServletRequest" New topic
Author

Difference between getRequestDispatcher() from ServletContext and HttpServletRequest

Pranav Pal
Ranch Hand

Joined: Nov 04, 2007
Posts: 74
What is the difference between RequestDispatcher object got from following two calls:
(1) getServletContext().getRequestDispatcher()
(2) request.getRequestDispatcher()

Thanks..


Hakuna Matata!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The difference is stated right in the API.
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getRequestDispatcher(java.lang.String)
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String)


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between getRequestDispatcher() from ServletContext and HttpServletRequest