クラス BasicErrorController
java.lang.ObjectSE
org.springframework.boot.webmvc.autoconfigure.error.AbstractErrorController
org.springframework.boot.webmvc.autoconfigure.error.BasicErrorController
- 実装済みのインターフェース一覧:
ErrorController
@Controller
@RequestMapping("${spring.web.error.path:${error.path:/error}}")
public class BasicErrorController
extends AbstractErrorController
基本的なグローバルエラー
@Controller、レンダリング ErrorAttributes。より具体的なエラーは、Spring MVC 抽象化(例: @ExceptionHandler)または registering error pages のいずれかを使用して処理できます。- 導入:
- 4.0.0
- 作成者:
- Dave Syer, Phillip Webb, Michael Stummvoll, Stephane Nicoll, Scott Frederick, Moritz Halbritter
- 関連事項:
コンストラクター概要
コンストラクターコンストラクター説明BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties) 新しいBasicErrorControllerインスタンスを作成します。BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties, ListSE<ErrorViewResolver> errorViewResolvers) 新しいBasicErrorControllerインスタンスを作成します。方法の概要
修飾子と型メソッド説明error(HttpServletRequest request) errorHtml(HttpServletRequest request, HttpServletResponse response) protected ErrorAttributeOptionsgetErrorAttributeOptions(HttpServletRequest request, MediaType mediaType) protected ErrorPropertiesエラープロパティへのアクセスを提供します。protected booleanisIncludeBindingErrors(HttpServletRequest request, MediaType produces) エラー属性を含めるかどうかを決定します。protected booleanisIncludeMessage(HttpServletRequest request, MediaType produces) メッセージ属性を含めるかどうかを決定します。protected booleanisIncludePath(HttpServletRequest request, MediaType produces) パス属性を含めるかどうかを決定します。protected booleanisIncludeStackTrace(HttpServletRequest request, MediaType produces) stacktrace 属性を含めるかどうかを決定します。mediaTypeNotAcceptable(HttpServletRequest request)
コンストラクターの詳細
BasicErrorController
新しいBasicErrorControllerインスタンスを作成します。- パラメーター:
errorAttributes- エラー属性errorProperties- 構成プロパティ
BasicErrorController
public BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties, ListSE<ErrorViewResolver> errorViewResolvers) 新しいBasicErrorControllerインスタンスを作成します。- パラメーター:
errorAttributes- エラー属性errorProperties- 構成プロパティerrorViewResolvers- エラービューリゾルバー
方法の詳細
errorHtml
@RequestMapping(produces="text/html") public ModelAndView errorHtml(HttpServletRequest request, HttpServletResponse response) error
@RequestMapping public ResponseEntity<MapSE<StringSE, @Nullable ObjectSE>> error(HttpServletRequest request) mediaTypeNotAcceptable
@ExceptionHandler(HttpMediaTypeNotAcceptableException.class) public ResponseEntity<StringSE> mediaTypeNotAcceptable(HttpServletRequest request) getErrorAttributeOptions
protected ErrorAttributeOptions getErrorAttributeOptions(HttpServletRequest request, MediaType mediaType) isIncludeStackTrace
stacktrace 属性を含めるかどうかを決定します。- パラメーター:
request- ソースリクエストproduces- 作成されたメディア型 (またはMediaType.ALL)- 戻り値:
- stacktrace 属性を含める必要がある場合
isIncludeMessage
メッセージ属性を含めるかどうかを決定します。- パラメーター:
request- ソースリクエストproduces- 作成されたメディア型 (またはMediaType.ALL)- 戻り値:
- メッセージ属性を含める必要がある場合
isIncludeBindingErrors
エラー属性を含めるかどうかを決定します。- パラメーター:
request- ソースリクエストproduces- 作成されたメディア型 (またはMediaType.ALL)- 戻り値:
- エラー属性を含める必要がある場合
isIncludePath
パス属性を含めるかどうかを決定します。- パラメーター:
request- ソースリクエストproduces- 作成されたメディア型 (またはMediaType.ALL)- 戻り値:
- パス属性を含めるかどうか
getErrorProperties