difference between forward and sendredirect
Answer Posted / dsr
FORWARD-->
1. THE REQUEST AND RESPONSE OBJECT REMAIN SAME.
2. CONTROL DIRECTLY GOES TO REQUESTED PAGE AT THE POINT
WHERE FORWARD IS CALLED.
3. REQUEST DISPATCHER IS NEEDED.
4.forward() is used to transfer the request within the web
application
SEND REDIRECT:--->
1.NEW REQUEST AND RESPONSE IS GENERATED IN CASE THIS CASE.
2.IN THIS CASE FIRST CONTROL GOES TO CLIENT(BROWSER) AND
THEN TO REQUESTED PAGE.
3.JUST RESPONSE OBJECT IS NEEDED.
4.sendRedirect() is used to transfer the request from same
webapplication or different webapplication.
| Is This Answer Correct ? | 13 Yes | 5 No |
Post New Answer View All Answers
What are the two important api's in for servlets?
How a servlet is unloaded?
Which java framework is most popular?
What is the requirement of servlet config and servlet context implemented and how are they implemented?
What is the difference between 2 types of servlets?
What are the life-cycle methods for a servlet?
What do you mean by cgi and what are its drawbacks?
Explain is servlet mapping?
What is getservletcontext?
What are Servlets?
What is setattribute in servlet?
Difference between GET and POST?
How do we share data using 'getservletcontext ()?
How to get the path of servlet in the server?
Explain web container.