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.

Posted

in

by

Tags:


Related Posts

Comments

2 responses to “Difference in SendRedirect() and RequestDispatcher() in Servlet”

  1. Michael McPherson Avatar
    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.

  2. nasos Avatar
    nasos

    SendRedirect
    This is the method of object HttpServlerResponse.
    There is a spelling mistake httpServletResponse

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading