OK, I got it now. If you read the HttpServletResponse Interface API, here is what it says for setStatus method:
Sets the status code for this response. This method is used to set the return status code when there is no error (for example, for the status codes SC_OK or SC_MOVED_TEMPORARILY). If there is an error, and the caller wishes to invoke an defined in the web applicaion, the sendError method should be used instead.
That would explain why the SC_INTERNAL_SERVER_ERROR is not the correct answer.