Please explain the difference between jsp:forward and redirect.
What is happening in each case?
Please explain the difference between jsp:forward and redirect . What is happening in each
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 sets the response status to 302 [1], and the new url in a
Locationheader, and sends the response to the browser. Then the browser, according to the http specification, makes another request to the new urlforward happens entirely on the server. The servlet container just forwards the same request to the target url, without the browser knowing about that. Hence you can use the same request attributes and the same request parameters when handling the new url. And the browser won’t know the url has changed (because it has happened entirely on the server)