getNamedDispatcher is the method as part of the Request interface.For this method you are passing the servlet name(this name you are providing as part of the web.xml(<servlet><servletname>servletname</servlet-name></servlet>
Amit Mohan Tiwari
Joined: Aug 21, 2006
What I want to know is as follows
where name is the name of the servlet given in deployment descriptor under <servlet-name> element and in deployment descriptor under <servlet-class> element we are given the name of the class of the servlet
where path is the location of the resources(Servlet,jsp,html etc) which we want to dispatch in our current servlet
SO WHAT I WANT TO ASK IS :
IF THE CASE IS THE ABOVE THEN WHY WE HAD THE NEED OF getNamedDispatcher(String name),because the getRequestDispatcher(String path)solves our purpose
with getRequestDispatcher(String) method, you can pass the control to any resource be it static or dynamic.And more over the path has to start with "/" as it is taken with refernce to the root context.
but in case of getNamedDispatcher(String), you can pass only to dynamic resource.