What is difference between Forward() and sendRedirect()
methode?

Answer Posted / sambasiva

Forward()

->Forward Method is available in RequestDispatcher which is
used to forward the request one component to another web
component which are available in same application
->Forward Method will happen completely on the ServerSide
->When u forwarding the request u can send the data from one
component to another component by attaching to request as an
attribute.
sendRedirect()

->This method available in HttpServletResponse which is used
to send the request from one component to another component
which are available in different application
->sendReddirect will happen both on client side or server side
->when u sendredirect the request u can send the data from
one component to another component as a query string.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between the servletconfig interface and the servletcontext interface?

582


What do you mean by annotations in servlet?

584


how the HTML data stored in web server?

1952


What is lazy loading and what is Generic Servlet Class?

611


What are the life cycle methods of a servlet?

593






How can the session in servlet can be destroyed?

711


Can we fetch the attributes related to a servlet on a different servlet?

635


What is pure servlet?

696


Explain the lifecycle of a servlet?

506


Why are http servlets used in programming?

546


What is dispatcher servlet?

559


What do you mean by deployment descriptor?

555


What is the capacity the doget can send to the server?

576


How httpservlet is different from the genericservlet?

566


How can we upload the file to the server using servlet?

544