cn.dreampie.common.http.exception
类 WebException

java.lang.Object
  继承者 java.lang.Throwable
      继承者 java.lang.Exception
          继承者 java.lang.RuntimeException
              继承者 cn.dreampie.common.http.exception.WebException
所有已实现的接口:
Serializable

public class WebException
extends RuntimeException

Created by ice on 14-12-19. A WebException can be raised to make resty return immediately an HTTP response with a specific HTTP status.

另请参见:
序列化表格

构造方法摘要
WebException(HttpStatus status)
           
WebException(HttpStatus status, Object content)
           
WebException(HttpStatus status, String message)
           
WebException(Object content)
           
WebException(String message)
           
 
方法摘要
 Object getContent()
          Returns the content to use in the HTTP response generated for this exception.
 HttpStatus getStatus()
           
 
从类 java.lang.Throwable 继承的方法
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

WebException

public WebException(HttpStatus status)

WebException

public WebException(String message)

WebException

public WebException(Object content)

WebException

public WebException(HttpStatus status,
                    String message)

WebException

public WebException(HttpStatus status,
                    Object content)
方法详细信息

getStatus

public HttpStatus getStatus()

getContent

public Object getContent()
Returns the content to use in the HTTP response generated for this exception.

Developer's note: override to provide a content different from the exception message. Alternatively you can override the writeTo method for full control over the response.

返回:
the content to use in the response.


Copyright © 2015. All rights reserved.