tag:blogger.com,1999:blog-8712770457197348465.post2437273569001061278..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: Difference between SendRedirect() and Forward() in JSP Servlet? Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8712770457197348465.post-17946938688623012462022-05-30T23:22:33.207-07:002022-05-30T23:22:33.207-07:00That's interesting, thanks for sharing with us...That's interesting, thanks for sharing with us, how did you come to know about that fact? Did you experienced yourself?javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-70893662993360068362022-05-30T03:23:52.124-07:002022-05-30T03:23:52.124-07:00there is one main difference which he forgot to me...there is one main difference which he forgot to mention is :<br />if we are doing registration os some kind and the data going to store in database. if we use forward() method to store that data and refresh the page on same url, the form will get submitted as amny times as user refreshes the page. <br />In sendRedirect() scenario, this wont be the case.<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-44381697025637070142013-02-01T01:29:09.425-08:002013-02-01T01:29:09.425-08:00What is difference in forward and sendredirect in ...What is difference in forward and sendredirect in Spring or Struts? does choice of any framework makes it easy or difficult to forward or redirect an HTTP request? I heard there are forward action in Struts framework, does that help in forwarding request?Aditinoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-7647321154413809522013-02-01T01:27:21.893-08:002013-02-01T01:27:21.893-08:00Isn't it there are include and forward action ...Isn't it there are include and forward action in JSP which can be used to forward a request instead of using RequestDispatcher forward method ?Bhartinoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-69083436831469362642013-02-01T01:26:26.519-08:002013-02-01T01:26:26.519-08:00Main difference between redirect and forward is in...Main difference between redirect and forward is involvement of browser. In HTTP forward, you forward same request to another resource e.g. JSP or Servlet in same server for processing and that resource return response back to client but client doesn't know anything about it. Client which is browser in this case think that it came from same URL which it sent request. While in case of HTTP Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-34266707596478921212011-12-01T01:30:48.124-08:002011-12-01T01:30:48.124-08:00does its same as difference between sendRedirect a...does its same as difference between sendRedirect and request dispatcher ?I am writing some jsp in my program and putting code I have writeen on Servlet where I hade used RequestDispatcher , Can you please suggest how Can I redirect or forward in JSP ?Chuanoreply@blogger.com