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 if you need to span your transaction across multiple servlet invocations?
What is cookie in servlet?
How would you create deadlock on your servlet?
What are the exceptions thrown by servlets? Why?
Why is Servlet so popular?
What is the functionality of actionservlet and requestprocessor?
Why doesn’t a servlet include main()? How does it work?
What is difference between the HTTP Servlet and Generic Servlet? Explain about their methods and parameters?
How can you start a jta transaction from a servlet deployed on jboss?
What is servlet and its life cycle?
What is servlet configuration?
What is context in servlet?
What are the uses of servlet and what is servlet chaining?
Define the lifecycle for executing a jsp page.
What is servlet collaboration?