void setStatus(int sc)
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 error-page defined in the web application, the sendError method should be used instead.
The container clears the buffer and sets the Location header, preserving cookies and other headers.
Parameters:
sc - the status code
tomcat上文档,链接http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServletResponse.html#setStatus(int)