If you call setStatus (it doesn't matter if it's an error or non-error status code), the
servlet is still responsible for providing the body of the response to the client.
Now, if the status code is, say, 404, and you'd mapped this to an error page in the deployment descriptor, then this probably explains why your error page is being displayed.