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 do you mean by cgi in servlet?
How do you create a cookie using servlet?
Write a program to show the functionality of servlets.
Why jsp is better than servlet?
What is the difference between sendredirect() and forward() in a servlet?
What are the objects involved when a servlet receives a call from client?
What is the difference between genericservlet and httpservlet
How does java thread pool work?
What do you mean by httpservlet?
What is pure servlet?
If servlet receives multiple requests, how many objects will it create?
How forward () method is different from send redirect () method?
What is the life cycle of a servlet?
A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?
What is Servlets and explain the advantages of Servlet life cycle?