When the client accesses a non-existent resource or a servlet in which an exception occurred, the Web container returns an error status code. The following table describes the error status codes returned by the Web container, and the conditions for returning the error status codes.
Error status codes |
Conditions for returning the error status code |
400 Bad Request |
The error status code 400 is returned in either of the following cases:
- When a client directly sends a request to a resource that is specified as the login page used for Form authentication, and the user is successfully authenticated from the login page that is displayed as a result of the request
- When the access satisfies all the following three conditions:
- The version of HTTP is "HTTP/1.0".
- The servlet to be accessed inherits javax.servlet.http.HttpServlet.
- The HTTP method at the access is not overwritten by the servlet.
- When an access is made by a request header with a Content-Length header value of greater than 2147483647 or smaller than 0
- When an access is made by a request header with a non-numeric Content-Length header value
- When an access is made by a request header containing multiple Content-Length headers
- When request URIs cannot be normalized
|
401 Unauthorized |
The error status code 401 is returned when a resource that requires Basic authentication is accessed as follows:
- The access uses an invalid user ID or password.
- The access does not include authentication information (the Authorization header).
|
403 Forbidden |
Error status code 403 is returned, when any of the following conditions is applicable:
- When a resource that requires the Basic or Form authentication is accessed using an unauthenticated user name
- When a resource that does not permit any access is accessed without any role-name element for the auth-constraint element being specified in web.xml#1
- When static contents are accessed by using the PUT or DELETE method
- When a resource whose <transport-guarantee> element in web.xml is set to INTEGRAL or CONFIDENTIAL is accessed via http#2
|
404 Not Found |
Error status code 404 is returned when any of the following is accessed:
- When a non-existent resource is accessed
- When a servlet or a JSP file in which javax.servlet.UnavailableException occurs, is accessed#3
|
405 Method Not Allowed |
Error status code 405 is returned in the case of an access that satisfies all of the following three conditions:
- When the HTTP version is "HTTP/1.1"
- When the servlet to be accessed inherits javax.servlet.http.HttpServlet
- When the HTTP method during access does not get overridden by the corresponding servlet
|
412 Precondition Failed |
Error status code 412 is returned, when the static contents that do not match the conditions specified in If-Match header or If-Unmodified-Since header, are accessed. |
413 Request Entity Too Large |
Error status code 413 is returned when the size of the request body exceeds the upper-limit value. |
416 Requested Range Not Satisfiable |
Error status code 416 is returned, when the static contents that use the value of an invalid Range header applicable to any of the following cases, are accessed:
- The value of Range header does not begin with "byte"
- A numeric character and "-" is not used in range definition
- The specified range is not appropriate
|
500 Internal Server Error |
Error status code 500 is returned, when any of the following conditions is applicable:
- When a servlet or a JSP file in which an exception occurs, is accessed#4
- When a JSP file whose compilation failed is accessed
- When deleted static contents are accessed#5
- When I/O error occurs when accessing the static contents
- When a resource protected by <auth-constraint> element is accessed, when the definition of web.xml is invalid#6
|
501 Not Implemented |
Error status code 501 is returned, when the static contents or the servlet that inherits javax.servlet.http.HttpServlet is accessed by an HTTP method other than the GET, HEAD, POST, PUT, DELETE, OPTIONS, and TRACE method. |
503 Service Unavailable |
Error status code 503 is returned, when any of the following conditions is applicable:
- When there is no space in the pending queue of requests#7
- When a servlet or JSP file in which javax.servlet.UnavailableException occurs, is accessed#8
- When a Web container being shut down is accessed
- When a Web application that is in abnormal state due to an unexpected error or exception, is accessed
- When only the Web container server is running and any Web applications are not running in the Web container server, and the Web application that was not started is accessed.
|