org.eclipse.jetty.http
类 HttpStatus

java.lang.Object
  继承者 org.eclipse.jetty.http.HttpStatus

public class HttpStatus
extends Object

HttpStatusCode enum class, for status codes based on various HTTP RFCs. (see table below)

Enum Code Message RFC 1945 - HTTP/1.0 RFC 2616 - HTTP/1.1 RFC 2518 - WEBDAV
Informational - 1xx isInformational(int)
CONTINUE_100 100 Continue   Sec. 10.1.1  
SWITCHING_PROTOCOLS_101 101 Switching Protocols   Sec. 10.1.2  
PROCESSING_102 102 Processing     Sec. 10.1
Success - 2xx isSuccess(int)
OK_200 200 OK Sec. 9.2 Sec. 10.2.1  
CREATED_201 201 Created Sec. 9.2 Sec. 10.2.2  
ACCEPTED_202 202 Accepted Sec. 9.2 Sec. 10.2.3  
NON_AUTHORITATIVE_INFORMATION_203 203 Non Authoritative Information   Sec. 10.2.4  
NO_CONTENT_204 204 No Content Sec. 9.2 Sec. 10.2.5  
RESET_CONTENT_205 205 Reset Content   Sec. 10.2.6  
PARTIAL_CONTENT_206 206 Partial Content   Sec. 10.2.7  
MULTI_STATUS_207 207 Multi-Status     Sec. 10.2
  207 Partial Update OK   draft/01  
Redirection - 3xx isRedirection(int)
MULTIPLE_CHOICES_300 300 Multiple Choices Sec. 9.3 Sec. 10.3.1  
MOVED_PERMANENTLY_301 301 Moved Permanently Sec. 9.3 Sec. 10.3.2  
MOVED_TEMPORARILY_302 302 Moved Temporarily Sec. 9.3 (now "302 Found")  
FOUND_302 302 Found (was "302 Moved Temporarily") Sec. 10.3.3  
SEE_OTHER_303 303 See Other   Sec. 10.3.4  
NOT_MODIFIED_304 304 Not Modified Sec. 9.3 Sec. 10.3.5  
USE_PROXY_305 305 Use Proxy   Sec. 10.3.6  
  306 (Unused)   Sec. 10.3.7  
TEMPORARY_REDIRECT_307 307 Temporary Redirect   Sec. 10.3.8  
Client Error - 4xx isClientError(int)
BAD_REQUEST_400 400 Bad Request Sec. 9.4 Sec. 10.4.1  
UNAUTHORIZED_401 401 Unauthorized Sec. 9.4 Sec. 10.4.2  
PAYMENT_REQUIRED_402 402 Payment Required Sec. 9.4 Sec. 10.4.3  
FORBIDDEN_403 403 Forbidden Sec. 9.4 Sec. 10.4.4  
NOT_FOUND_404 404 Not Found Sec. 9.4 Sec. 10.4.5  
METHOD_NOT_ALLOWED_405 405 Method Not Allowed   Sec. 10.4.6  
NOT_ACCEPTABLE_406 406 Not Acceptable   Sec. 10.4.7  
PROXY_AUTHENTICATION_REQUIRED_407 407 Proxy Authentication Required   Sec. 10.4.8  
REQUEST_TIMEOUT_408 408 Request Timeout   Sec. 10.4.9  
CONFLICT_409 409 Conflict   Sec. 10.4.10  
GONE_410 410 Gone   Sec. 10.4.11  
LENGTH_REQUIRED_411 411 Length Required   Sec. 10.4.12  
PRECONDITION_FAILED_412 412 Precondition Failed   Sec. 10.4.13  
REQUEST_ENTITY_TOO_LARGE_413 413 Request Entity Too Large   Sec. 10.4.14  
REQUEST_URI_TOO_LONG_414 414 Request-URI Too Long   Sec. 10.4.15  
UNSUPPORTED_MEDIA_TYPE_415 415 Unsupported Media Type   Sec. 10.4.16  
REQUESTED_RANGE_NOT_SATISFIABLE_416 416 Requested Range Not Satisfiable   Sec. 10.4.17  
EXPECTATION_FAILED_417 417 Expectation Failed   Sec. 10.4.18  
  418 Reauthentication Required   draft/01  
  418 Unprocessable Entity     draft/05
  419 Proxy Reauthentication Required   draft/01  
  419 Insufficient Space on Resource     draft/05
  420 Method Failure     draft/05
  421 (Unused)      
UNPROCESSABLE_ENTITY_422 422 Unprocessable Entity     Sec. 10.3
LOCKED_423 423 Locked     Sec. 10.4
FAILED_DEPENDENCY_424 424 Failed Dependency     Sec. 10.5
Server Error - 5xx isServerError(int)
INTERNAL_SERVER_ERROR_500 500 Internal Server Error Sec. 9.5 Sec. 10.5.1  
NOT_IMPLEMENTED_501 501 Not Implemented Sec. 9.5 Sec. 10.5.2  
BAD_GATEWAY_502 502 Bad Gateway Sec. 9.5 Sec. 10.5.3  
SERVICE_UNAVAILABLE_503 503 Service Unavailable Sec. 9.5 Sec. 10.5.4  
GATEWAY_TIMEOUT_504 504 Gateway Timeout   Sec. 10.5.5  
HTTP_VERSION_NOT_SUPPORTED_505 505 HTTP Version Not Supported   Sec. 10.5.6  
  506 (Unused)      
INSUFFICIENT_STORAGE_507 507 Insufficient Storage     Sec. 10.6

版本:
$Id$

嵌套类摘要
static class HttpStatus.Code
           
 
字段摘要
static int ACCEPTED_202
           
static int BAD_GATEWAY_502
           
static int BAD_REQUEST_400
           
static int CONFLICT_409
           
static int CONTINUE_100
           
static int CREATED_201
           
static int EXPECTATION_FAILED_417
           
static int FAILED_DEPENDENCY_424
           
static int FORBIDDEN_403
           
static int FOUND_302
           
static int GATEWAY_TIMEOUT_504
           
static int GONE_410
           
static int HTTP_VERSION_NOT_SUPPORTED_505
           
static int INSUFFICIENT_STORAGE_507
           
static int INTERNAL_SERVER_ERROR_500
           
static int LENGTH_REQUIRED_411
           
static int LOCKED_423
           
static int MAX_CODE
           
static int METHOD_NOT_ALLOWED_405
           
static int MOVED_PERMANENTLY_301
           
static int MOVED_TEMPORARILY_302
           
static int MULTI_STATUS_207
           
static int MULTIPLE_CHOICES_300
           
static int NO_CONTENT_204
           
static int NON_AUTHORITATIVE_INFORMATION_203
           
static int NOT_ACCEPTABLE_406
           
static int NOT_FOUND_404
           
static int NOT_IMPLEMENTED_501
           
static int NOT_MODIFIED_304
           
static int OK_200
           
static int PARTIAL_CONTENT_206
           
static int PAYMENT_REQUIRED_402
           
static int PRECONDITION_FAILED_412
           
static int PROCESSING_102
           
static int PROXY_AUTHENTICATION_REQUIRED_407
           
static int REQUEST_ENTITY_TOO_LARGE_413
           
static int REQUEST_TIMEOUT_408
           
static int REQUEST_URI_TOO_LONG_414
           
static int REQUESTED_RANGE_NOT_SATISFIABLE_416
           
static int RESET_CONTENT_205
           
static int SEE_OTHER_303
           
static int SERVICE_UNAVAILABLE_503
           
static int SWITCHING_PROTOCOLS_101
           
static int TEMPORARY_REDIRECT_307
           
static int UNAUTHORIZED_401
           
static int UNPROCESSABLE_ENTITY_422
           
static int UNSUPPORTED_MEDIA_TYPE_415
           
static int USE_PROXY_305
           
 
构造方法摘要
HttpStatus()
           
 
方法摘要
static HttpStatus.Code getCode(int code)
          Get the HttpStatusCode for a specific code
static String getMessage(int code)
          Get the status message for a specific code.
static boolean isClientError(int code)
          Simple test against an code to determine if it falls into the Client Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
static boolean isInformational(int code)
          Simple test against an code to determine if it falls into the Informational message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
static boolean isRedirection(int code)
          Simple test against an code to determine if it falls into the Redirection message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
static boolean isServerError(int code)
          Simple test against an code to determine if it falls into the Server Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
static boolean isSuccess(int code)
          Simple test against an code to determine if it falls into the Success message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

CONTINUE_100

public static final int CONTINUE_100
另请参见:
常量字段值

SWITCHING_PROTOCOLS_101

public static final int SWITCHING_PROTOCOLS_101
另请参见:
常量字段值

PROCESSING_102

public static final int PROCESSING_102
另请参见:
常量字段值

OK_200

public static final int OK_200
另请参见:
常量字段值

CREATED_201

public static final int CREATED_201
另请参见:
常量字段值

ACCEPTED_202

public static final int ACCEPTED_202
另请参见:
常量字段值

NON_AUTHORITATIVE_INFORMATION_203

public static final int NON_AUTHORITATIVE_INFORMATION_203
另请参见:
常量字段值

NO_CONTENT_204

public static final int NO_CONTENT_204
另请参见:
常量字段值

RESET_CONTENT_205

public static final int RESET_CONTENT_205
另请参见:
常量字段值

PARTIAL_CONTENT_206

public static final int PARTIAL_CONTENT_206
另请参见:
常量字段值

MULTI_STATUS_207

public static final int MULTI_STATUS_207
另请参见:
常量字段值

MULTIPLE_CHOICES_300

public static final int MULTIPLE_CHOICES_300
另请参见:
常量字段值

MOVED_PERMANENTLY_301

public static final int MOVED_PERMANENTLY_301
另请参见:
常量字段值

MOVED_TEMPORARILY_302

public static final int MOVED_TEMPORARILY_302
另请参见:
常量字段值

FOUND_302

public static final int FOUND_302
另请参见:
常量字段值

SEE_OTHER_303

public static final int SEE_OTHER_303
另请参见:
常量字段值

NOT_MODIFIED_304

public static final int NOT_MODIFIED_304
另请参见:
常量字段值

USE_PROXY_305

public static final int USE_PROXY_305
另请参见:
常量字段值

TEMPORARY_REDIRECT_307

public static final int TEMPORARY_REDIRECT_307
另请参见:
常量字段值

BAD_REQUEST_400

public static final int BAD_REQUEST_400
另请参见:
常量字段值

UNAUTHORIZED_401

public static final int UNAUTHORIZED_401
另请参见:
常量字段值

PAYMENT_REQUIRED_402

public static final int PAYMENT_REQUIRED_402
另请参见:
常量字段值

FORBIDDEN_403

public static final int FORBIDDEN_403
另请参见:
常量字段值

NOT_FOUND_404

public static final int NOT_FOUND_404
另请参见:
常量字段值

METHOD_NOT_ALLOWED_405

public static final int METHOD_NOT_ALLOWED_405
另请参见:
常量字段值

NOT_ACCEPTABLE_406

public static final int NOT_ACCEPTABLE_406
另请参见:
常量字段值

PROXY_AUTHENTICATION_REQUIRED_407

public static final int PROXY_AUTHENTICATION_REQUIRED_407
另请参见:
常量字段值

REQUEST_TIMEOUT_408

public static final int REQUEST_TIMEOUT_408
另请参见:
常量字段值

CONFLICT_409

public static final int CONFLICT_409
另请参见:
常量字段值

GONE_410

public static final int GONE_410
另请参见:
常量字段值

LENGTH_REQUIRED_411

public static final int LENGTH_REQUIRED_411
另请参见:
常量字段值

PRECONDITION_FAILED_412

public static final int PRECONDITION_FAILED_412
另请参见:
常量字段值

REQUEST_ENTITY_TOO_LARGE_413

public static final int REQUEST_ENTITY_TOO_LARGE_413
另请参见:
常量字段值

REQUEST_URI_TOO_LONG_414

public static final int REQUEST_URI_TOO_LONG_414
另请参见:
常量字段值

UNSUPPORTED_MEDIA_TYPE_415

public static final int UNSUPPORTED_MEDIA_TYPE_415
另请参见:
常量字段值

REQUESTED_RANGE_NOT_SATISFIABLE_416

public static final int REQUESTED_RANGE_NOT_SATISFIABLE_416
另请参见:
常量字段值

EXPECTATION_FAILED_417

public static final int EXPECTATION_FAILED_417
另请参见:
常量字段值

UNPROCESSABLE_ENTITY_422

public static final int UNPROCESSABLE_ENTITY_422
另请参见:
常量字段值

LOCKED_423

public static final int LOCKED_423
另请参见:
常量字段值

FAILED_DEPENDENCY_424

public static final int FAILED_DEPENDENCY_424
另请参见:
常量字段值

INTERNAL_SERVER_ERROR_500

public static final int INTERNAL_SERVER_ERROR_500
另请参见:
常量字段值

NOT_IMPLEMENTED_501

public static final int NOT_IMPLEMENTED_501
另请参见:
常量字段值

BAD_GATEWAY_502

public static final int BAD_GATEWAY_502
另请参见:
常量字段值

SERVICE_UNAVAILABLE_503

public static final int SERVICE_UNAVAILABLE_503
另请参见:
常量字段值

GATEWAY_TIMEOUT_504

public static final int GATEWAY_TIMEOUT_504
另请参见:
常量字段值

HTTP_VERSION_NOT_SUPPORTED_505

public static final int HTTP_VERSION_NOT_SUPPORTED_505
另请参见:
常量字段值

INSUFFICIENT_STORAGE_507

public static final int INSUFFICIENT_STORAGE_507
另请参见:
常量字段值

MAX_CODE

public static final int MAX_CODE
另请参见:
常量字段值
构造方法详细信息

HttpStatus

public HttpStatus()
方法详细信息

getCode

public static HttpStatus.Code getCode(int code)
Get the HttpStatusCode for a specific code

参数:
code - the code to lookup.
返回:
the HttpStatus if found, or null if not found.

getMessage

public static String getMessage(int code)
Get the status message for a specific code.

参数:
code - the code to look up
返回:
the specific message, or the code number itself if code does not match known list.

isInformational

public static boolean isInformational(int code)
Simple test against an code to determine if it falls into the Informational message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.

参数:
code - the code to test.
返回:
true if within range of codes that belongs to Informational messages.

isSuccess

public static boolean isSuccess(int code)
Simple test against an code to determine if it falls into the Success message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.

参数:
code - the code to test.
返回:
true if within range of codes that belongs to Success messages.

isRedirection

public static boolean isRedirection(int code)
Simple test against an code to determine if it falls into the Redirection message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.

参数:
code - the code to test.
返回:
true if within range of codes that belongs to Redirection messages.

isClientError

public static boolean isClientError(int code)
Simple test against an code to determine if it falls into the Client Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.

参数:
code - the code to test.
返回:
true if within range of codes that belongs to Client Error messages.

isServerError

public static boolean isServerError(int code)
Simple test against an code to determine if it falls into the Server Error message category as defined in the RFC 1945 - HTTP/1.0, and RFC 2616 - HTTP/1.1.

参数:
code - the code to test.
返回:
true if within range of codes that belongs to Server Error messages.


Copyright © 2013. All Rights Reserved.