クラス DefaultErrorAttributes

java.lang.ObjectSE
org.springframework.boot.web.servlet.error.DefaultErrorAttributes
実装されたすべてのインターフェース:
ErrorAttributesOrderedHandlerExceptionResolver

@Order(-2147483648) public class DefaultErrorAttributes extends ObjectSE implements ErrorAttributes, HandlerExceptionResolver, Ordered
ErrorAttributes のデフォルト実装。可能な場合、次の属性を提供します。
  • timestamp - エラーが抽出された時間
  • status - 状態コード
  • error - エラーの理由
  • exception - ルート例外のクラス名 (設定されている場合)
  • message - 例外メッセージ (設定されている場合)
  • errors - BindingResult または MethodValidationResult 例外からの ObjectError (設定されている場合)
  • trace - 例外スタックトレース (設定されている場合)
  • path - 例外が発生したときの URL パス
導入:
2.0.0
作成者:
Phillip Webb, Dave Syer, Stephane Nicoll, Vedran Pavic, Scott Frederick, Yanming Zhou
関連事項:
  • コンストラクターの詳細

    • DefaultErrorAttributes

      public DefaultErrorAttributes()
  • メソッドの詳細

    • getOrder

      public int getOrder()
      次で指定:
      インターフェース OrderedgetOrder 
    • resolveException

      public ModelAndView resolveException(HttpServletRequestEE request, HttpServletResponseEE response, ObjectSE handler, ExceptionSE ex)
      次で指定:
      インターフェース HandlerExceptionResolverresolveException 
    • getErrorAttributes

      public MapSE<StringSE,ObjectSE> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options)
      インターフェースからコピーされた説明: ErrorAttributes
      エラー属性の MapSE を返します。マップは、エラーページ ModelAndView のモデルとして使用するか、@ResponseBody として返すことができます。
      次で指定:
      インターフェース ErrorAttributesgetErrorAttributes 
      パラメーター:
      webRequest - ソースリクエスト
      options - エラー属性コンテンツのオプション
      戻り値:
      エラー属性のマップ
    • getMessage

      protected StringSE getMessage(WebRequest webRequest, ThrowableSE error)
      message エラー属性の値として含まれるメッセージを返します。デフォルトでは、返されるメッセージは空ではない次の最初のものです。
      1. RequestDispatcher.ERROR_MESSAGEEE リクエスト属性の値。
      2. 与えられた error のメッセージ。
      3. No message available.
      パラメーター:
      webRequest - 現在のリクエスト
      error - 現在のエラー(ある場合)
      戻り値:
      エラー属性に含めるメッセージ
      導入:
      2.4.0
    • getError

      public ThrowableSE getError(WebRequest webRequest)
      インターフェースからコピーされた説明: ErrorAttributes
      エラーの根本的な原因を返すか、エラーを抽出できない場合は null を返します。
      次で指定:
      インターフェース ErrorAttributesgetError 
      パラメーター:
      webRequest - ソースリクエスト
      戻り値:
      エラーまたは null の原因となった ExceptionSE