File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Request Dispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Request Dispatcher" Watch "Request Dispatcher" New topic

Request Dispatcher

Narahari Raidurg

Joined: Feb 07, 2001
Posts: 3
what is Request Dispatcher? Is there any diff bet it & sendredirect?
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
The RequestDispatcher object handles over the ServletRequest from one servlet/JSP to another. And maybe to another, etc. until the response is sent to the client.
A HttpServletResponse.sendRedirect() tells the browser to request a different URI all by itself. Thus new URL shows up in the browser address area. With the RequestDispatcher this does not happen.

Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
I agree. Here's the link:
subject: Request Dispatcher
It's not a secret anymore!