Total members 11890 |It is currently Fri Apr 19, 2024 10:01 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





What is the Difference between forward and sendRedirect?

When you invoke a forward request, the request is sent to another resource on the server, without the client being informed that a different resource is going to process the request. This process occurs completely with in the web container. When a sendRedirtect method is invoked, it causes the web container to return to the browser indicating that a new URL should be requested. Because the browser issues a completely new request any object that are stored as request attributes before the redirect occurs will be lost. This extra round trip a redirect is slower than forward.



_________________
Please recommend my post if you found it helpful


Author:
Newbie
User avatar Posts: 14
Have thanks: 0 time

forward runs on the server side while sendRedirect runs on the client as well as on the server side thats why the response generated by sendRedirect() is slow as compared to rd.forward().By using sendRedirect() you can forward the request to any web application either in the same server or to the another one.Incase of forward() the request has to be forwarded to the same web application.One more difference is that forward() method holds the previous request and response objects while using sendRedirect(),it will create fresh request and response objects


Author:
Newbie
User avatar Posts: 29
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : Difference between forward and sendRedirect
 USB programming back and forward button     -  
 difference between the >> and >>> operators     -  
 difference between a MenuItem and a CheckboxMenuItem     -  
 Difference between Externalization and Serialzation     -  
 difference between the Boolean & operator and the &&     -  
 Difference between throw and throws     -  
 Difference between PHP echo() and PHP print()?     -  
 difference between upcasting and downcasting     -  
 difference between the String and StringBuffer     -  
 find the difference between dates in asp.net     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com