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

Answer Posted / vikram raj bakshi

I'll explain this with an example. If suppose u ask ur
servant(who is uneducated), to go to the market and get u a
Pepsodent.Now if the shopkeeper is not having a pepsodent
he will simply hand over Close Up to the servant.This
scenario is something simialr to the "forward" method. If
the requested resource is not available u will be
redirected to a different page whose url is specifiedd in
the forward method call. But u wont be able to see the
cnage in the url in the address bar. It's all done
internaly. In case os sendRedirect, its just like ur call
is moving from one page to another and u will able to see
the cnage in the url too. Its like normal page navigation.
Hope you would have a got a picture of it.

Is This Answer Correct ?    25 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define orm and its working in j2ee?

531


What is server in j2ee?

473


What is document?

518


What is a java ee container?

468


What is instance in java?

486






What is a plugin in java?

469


What does j2ee stand for?

474


What is the best java course?

496


what is meant by proxy server

4159


What are the components of J2EE application?

516


Is core java and j2se same?

455


What is ejb jar file?

463


What is declaration?

564


What is deployer?

548


Which edition of java is used for web application?

467