What is the difference between sendRedirect() and forward()?
in what situations do we have to use send redirect()
instead of forward().
Answer Posted / bhupathi.vm
1.forward will forward the request without saving the client
information where as sendRedirect will save the previous
information and send to another requested page.
2.The forward operation happens in the same request itself.
Once if you forward a request, you cannot add any more
response content after the forward command. Becuase, the
servlet ignores the remaining things and forwards the
request to another servlet.
The send redirect is the one, which redirects you to some
other servlet or page. The redirection is not within the
same request, but it is a new request. Using send redirect,
you can access a page available on another context / server.
| Is This Answer Correct ? | 11 Yes | 9 No |
Post New Answer View All Answers
What is jradiobutton in java?
What is j2ee application model?
What are the four types of J2EE modules?
What is full form of j2ee?
What is j2ee and j2se?
What does the application client module contain?
How does javac compiler work?
What is a panel java?
On which platform j2ee is based?
What is java ee server?
How will you explain load() and get() methods?
What is jlayeredpane java?
How is java development environment setup?
Why tomcat is used in java?
What is java api for xml-based rpc (jax-rpc)?