aspose file tools
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

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

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: 3222
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