aspose 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Difference between getRequestDispatcher() from ServletContext and HttpServletRequest
 
Similar Threads
getRequestDispatcher
RequestDispathcher
Diff getNamedDispatcher() & getRequestDispatcher()
getRequestDispatcher
RequestDispatcher