I am new to servlet development, and I was reading an ebook, and found that I can redirect to a different web page using
setHeader(\"Location\", \"http://ww
As you can see, the response is still HTTP/1.1 200 OK. To indicate a redirect, you need to send back a 302 status code:
HTTP/1.1 200 OK
response.setStatus(HttpServletResponse.SC_FOUND); // SC_FOUND = 302