It's not a secret anymore!*
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 Android Security Essentials Live Lessons this week in the Android 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
Consider Paul's rocket mass heater.
subject: Request Dispatcher
Similar Threads
Request Dispatcher.
dispatcher action
Request Scope
Getting the Servlet output in a JSP file
how to pass control to another page with out using request dispatch