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


Please Help Members By Posting Answers For Below Questions

What do you mean by cgi in servlet?

624


How do you create a cookie using servlet?

575


Write a program to show the functionality of servlets.

553


Why jsp is better than servlet?

526


What is the difference between sendredirect() and forward() in a servlet?

523






What are the objects involved when a servlet receives a call from client?

545


What is the difference between genericservlet and httpservlet

582


How does java thread pool work?

542


What do you mean by httpservlet?

561


What is pure servlet?

691


If servlet receives multiple requests, how many objects will it create?

825


How forward () method is different from send redirect () method?

513


What is the life cycle of a servlet?

779


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 ?

604


What is Servlets and explain the advantages of Servlet life cycle?

579