File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes redirect() vs getRequestDispatcher() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "redirect() vs getRequestDispatcher() " Watch "redirect() vs getRequestDispatcher() " New topic

redirect() vs getRequestDispatcher()

Shubha Krishna

Joined: Aug 18, 2006
Posts: 13
Can anybody help me to know the difference between response.redirect() and request.getRequestDispatcher()? Thanks...
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

One is used to perform a forward or include, the other a redirect.

Perhaps a more expansive question would yield a more expansive answer.

[Asking smart questions] [About Bear] [Books by Bear]
subject: redirect() vs getRequestDispatcher()
It's not a secret anymore!