Difference in SendRedirect() and RequestDispatcher() in Servlet

Author posted by Jitendra on Posted on under category Categories Servlet and tagged as Tags with 1 Comment on Difference in SendRedirect() and RequestDispatcher() in Servlet

difference in SendRedirect() and RequestDispatcher() in Servlet

SendRedirect

  • This is the method of object HttpServlerResponse.
  • Request is redirected to client (Browser), and it will process the new URL.
  • End User can see on which page, url is redirected.
  • In Nutshell, Processing done at client side.

RequestDispatcher

  • This object can be accessed from HttpServletRequest.
  • Servlet will internally forward the request to another servlet or jsp page.
  • End user don’t know that which page is processed internally.
  • In Nutshell, Processing done at server side.

Related posts

  • Michael McPherson

    Hi there! I simply wish to give an enormous thumbs up for the nice data you’ve right here on this post. I shall be coming back to your blog for more soon.