I am using servlet there is two method redirect and forward both are send request to the same page but what is the difference between them.any idea
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
redirect – it uses a browser redirect. It sends an http response with code 3xx (see wikipedia), and then the browser makes another request to the new page
forward – forward is internal for the servlet container. The browser never understands that the page has changed. Hence the URL doesn’t change (like with redirect), and you have the same request in the new page as well.