What is the difference between sendRedirect() and forward()?
in what situations do we have to use send redirect()
instead of forward().

Answer Posted / vinit sharma

Hello i am vinit and according to me,

Both methods are use to transfer form one web component to
another web component.

In case of forward () the same request (that have client
information) is passed from server side to the another page
(this another page should be in the same container (Web
Server)), due to URL remains same.

While in sendRedirect () a new request (due to
loss the previous request information) is generated from
client side to another page (this another page can be in
the same OR in different container (Web Server)), due to
URL becomes change.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which server is best for java?

447


Why is java robust?

647


Where can I find java developers?

507


Is core java and j2se same?

455


Which software is used for java?

467






What is java netbeans?

488


What is the container?

558


Which is best eclipse for java?

483


What is j2ee component?

503


What is j2ee application?

531


What is a jbutton in java?

513


What are the components of J2EE application?

516


What does java ee stand for?

440


What is instance in java?

486


What is interpreter in java?

445