sendError will trigger the <error-page> defined in web.xml.
setStatus() won't. if you use setStatus, you have to provide the content to be returned. that is, you need out.print(...), etc, and set some HTTP response header if it is necessary. sendError will set all the headers automatically for you.
so setStatus() should only be used for setting normal HTTP response status, not for error status. for error status
you should use sendError().
sendRedirect() and requestDispatcher.forward() is very very different.
1. sendRedirect set the "location" HTTP response header, and send back the HTTP response. your browser get the response, and then sends the new HTTP request to the URL set in "location" header.
RequestDispatcher is transparent to the browser, your web-container will go send the HTTP request to the URL, get the response, and send it back to the browser, the browser does not even know the resouse is actually from that URL.
2. sendRedirect(url), the url could be any URL, it could be out of your web-application, say,
www.yahoo.com. but RequestDispatcher() can ONLY forward to the url that is part of your web-application, it could never be an absolute URL.