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

Answer Posted / fateh

the main difference is that forward() do not save the
information while sending to the client but on the other
hand sendRedirect() saves the information while redirecting
to the other page.

Basically, sendRedirect() is used to redirect ot the error
page and forward() is a request dispatcher method to forward
request to the new page. So, if we are talking in this
context sendRedirect() is faster than forward(). According
to he above mentioned concept, forward() is faster than
sendRedirect() but if we are using sendRedirect() to send to
the error page it is faster.

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java gui?

503


What is single tier architecture in java?

485


I Want build and release interview questions

3127


Who is java developer?

519


What is java api for xml registries (jaxr)?

547






Define authorization constraint?

545


What is commit?

640


What is java listener?

502


What every java developer should know?

475


What is ejb jar file?

468


What are the components of j2ee?

457


What is java developer?

474


What is j2ee api?

522


What is pure java?

525


What is Document Object Model?

559