Why do we have two ways of creating a RequestDispatcher ? One through the request object and other through the servletcontext object. One syntax different that I understand is that the first accepts the relative path, while the later accepts absolute path. Aprt from this syntax difference , is there any logical difference between the two ways ?
posted 10 years ago
The relative path cannot extend outside the current servlet context. To do so, you must use the getContext() method. It returns the absolute URL to the context requested.