GeekInterview.com
Series: Subject: Topic:
Question: 43 of 46

Difference between forward(request,response) and SendRedirect(url) in Servlet?

With Forward, request & response would be passed to the destination URL which should be relative means that the destination URL shud be within a servlet context). Also, after executing forward method, the control will return back to the same method from where the forward method was called. All the opposite to the above points apply to sendRedirect.
(OR)The forward will redirect in the application server itself. It does not come to the client. whereas Response.sendredirect() will come to the client and go back ...ie. URL appending will happen.
Asked by: Interview Candidate | Asked on: Dec 18th, 2003
Showing Answers 1 - 1 of 1 Answers

forward(request,response) is used to comlete its process in servlet.
sendredirect(url)is used to give or transfer the task to other browser not servlet . 

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.