dcsimg
Differnce between request.getRequestDispatcher() and ServletConfig.getRequestDispatcher()
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aejaz_Sheriff
Posted On:   Saturday, August 4, 2001 02:41 PM

Hi



What is the Difference between a RequestDispatcher object obtained from The Request Object and RequestDispatcher object obtained from ServletContext . If at all there is a difference?
i.e

			
request.getRequestDispatcher("url").forward(request,response);
and
			
getServletConfig().getServletContext().getRequestDispatcher("url").forward(request,response);

Re: Differnce between request.getRequestDispatcher() and ServletConfig.getRequestDispatcher()

Posted By:   Christopher_Pickslay  
Posted On:   Saturday, August 4, 2001 05:51 PM

There's no difference. They both return the same object.

getServletConfig().getServletContext().getRequestDispatcher() allows you to dispatch requests if you don't have access to the HttpServletRequest object, for example if you're in a method you've written which doesn't take the HttpServletRequest object as a parameter.

About | Sitemap | Contact