Forums Register Login

Which one is better forward() or sendRedirect() ????

+Pie Number of slices to send: Send
Are there any advantages of using forward() over sendredirect() apart from the fact that with forward() request are not sent to the client where as with sendredirect() client initiates a new request.
+Pie Number of slices to send: Send
Forwarding ususally has a fast performance within the same application, because the forward is done internally.

If you use redirect, your request will be processed twice, since the server tells you to fire another request on your own.

Nick
+Pie Number of slices to send: Send
Oh, I forget to mention that, the number of requests to be handled simutaneously, the network bandwidth, the round trip time etc will also be your consideration.

As the network cost of redirecting a request to the application within the same server costs double that than using forward.

Nick
Who knew that furniture could be so violent? Put this tiny ad out there to see what happens:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 584 times.
Similar Threads
Difference between forward and SendRedirect?
passing variables in response.sendRedirect
forward and sendRedirect methods
Usage of sendRedirect()?
Difference b/w sendRedirect and forward
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:42:52.