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 does java awt stand for?
How long does it take to master java?
Why is java called technology?
How do you run a java program?
What is the difference between session bean and entity bean ?
Is string a primitive data type in java?
What is create method?
what is direct link to download swing ebook,applet,ejb,core java
How do you make a class immutable in java?
What are the technologies a java developer must know?
What is java ee server?
Which framework is best for java?
What is java gui?
What is japplet in java?
What do you understand by j2ee?