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
What is Document Object Model?
What is bean factory, have you used xmlbean factory?
What are container services?
What is cmp in j2ee?
What is java api for xml processing (jaxp)?
Is advanced java and j2ee same?
What is use of final keyword in java?
Who is java developer?
Is tomcat a java ee?
Define hashtable in j2ee?
What are the main components of the j2ee application?
What is a java developer?
What is a java application client?
Describe orm?
What is a plugin in java?