@Controller @RequestMapping(value="${server.error.path:${error.path:/error}}") public class BasicErrorController extends AbstractErrorController
@Controller
、レンダリング ErrorAttributes
。より具体的なエラーは、Spring MVC 抽象化 (例: @ExceptionHandler
) を使用するか、サーブレット server error pages
を追加することで処理できます。ErrorAttributes
, ErrorProperties
コンストラクターと説明 |
---|
BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties) 新しい BasicErrorController インスタンスを作成します。 |
BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties, ListSE<ErrorViewResolver> errorViewResolvers) 新しい BasicErrorController インスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
ResponseEntity<MapSE<StringSE, ObjectSE>> | error(HttpServletRequestEE request) |
ModelAndView | errorHtml(HttpServletRequestEE request, HttpServletResponseEE response) |
protected ErrorAttributeOptions | getErrorAttributeOptions(HttpServletRequestEE request, MediaType mediaType) |
protected ErrorProperties | getErrorProperties() エラープロパティへのアクセスを提供します。 |
protected boolean | isIncludeBindingErrors(HttpServletRequestEE request, MediaType produces) エラー属性を含めるかどうかを決定します。 |
protected boolean | isIncludeMessage(HttpServletRequestEE request, MediaType produces) メッセージ属性を含めるかどうかを決定します。 |
protected boolean | isIncludeStackTrace(HttpServletRequestEE request, MediaType produces) stacktrace 属性を含めるかどうかを決定します。 |
ResponseEntity<StringSE> | mediaTypeNotAcceptable(HttpServletRequestEE request) |
getBooleanParameter, getErrorAttributes, getErrorsParameter, getMessageParameter, getStatus, getTraceParameter, resolveErrorView
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties)
BasicErrorController
インスタンスを作成します。errorAttributes
- エラー属性 errorProperties
- 構成プロパティ public BasicErrorController(ErrorAttributes errorAttributes, ErrorProperties errorProperties, ListSE<ErrorViewResolver> errorViewResolvers)
BasicErrorController
インスタンスを作成します。errorAttributes
- エラー属性 errorProperties
- 構成プロパティ errorViewResolvers
- エラービューリゾルバー @RequestMapping(produces="text/html") public ModelAndView errorHtml(HttpServletRequestEE request, HttpServletResponseEE response)
@RequestMapping public ResponseEntity<MapSE<StringSE,ObjectSE>> error(HttpServletRequestEE request)
@ExceptionHandler(value=org.springframework.web.HttpMediaTypeNotAcceptableException.class) public ResponseEntity<StringSE> mediaTypeNotAcceptable(HttpServletRequestEE request)
protected ErrorAttributeOptions getErrorAttributeOptions(HttpServletRequestEE request, MediaType mediaType)
protected boolean isIncludeStackTrace(HttpServletRequestEE request, MediaType produces)
request
- ソースリクエスト produces
- 作成されたメディア型 (または MediaType.ALL
)protected boolean isIncludeMessage(HttpServletRequestEE request, MediaType produces)
request
- ソースリクエスト produces
- 作成されたメディア型 (または MediaType.ALL
)protected boolean isIncludeBindingErrors(HttpServletRequestEE request, MediaType produces)
request
- ソースリクエスト produces
- 作成されたメディア型 (または MediaType.ALL
)protected ErrorProperties getErrorProperties()