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

Answer Posted / n.muthukumar

sendRedirect() sends a redirect response back to the
client's browser.
forward() does not involve the client's browser.
The forward( ) is faster than Sendredirect( ).
RequestDispatcher.forward( ) works on the Server.

when you use send redirect it will rediredct the url to new
url and It will be displayed in browser.
response.sendRedirect(http://162.1.1.0/error.html);

When you use forward it will forward to particular page but
in browser forwarded url won't dispaly
<jsp:forward page http://162.1.1.0/error.html) />

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name the packages that work with servlet?

547


What methods do you use in servlet - applet communication?

584


Define the life cycle of a servlets.

576


What are different ways for servlet authentication?

567


What is http servlet in java?

566






The code in a finally clause will never fail to execute, right?

605


Can we use threads in Servlets?

656


Why session tracking is needed?

588


What are session variable in servlets?

568


How servlet is created?

548


Describe servlet?

582


What are the kinds of http requests?

611


Is servlet thread safe?

523


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

553


How does tomcat servlet container work?

592