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

What is the container?

732


What is a jpanel in java?

668


What are the components of j2ee?

645


What is application assembler?

700


What do you mean by the deployment descriptor?

699


What is bean factory, have you used xmlbean factory?

709


Which is latest technology in java?

661


Explain the four types of container that the j2ee specification defines

685


What is fatal error?

777


Which java technology is in demand?

671


What is server in j2ee?

644


How to invoke stored procedure in hibernate?

654


What is java full stack developer?

658


What is event and listener in java?

593


What is devops in java?

725