クラス SystemExceptionResolver
- すべての実装されたインタフェース:
org.springframework.core.Ordered
,org.springframework.web.servlet.HandlerExceptionResolver
-
フィールドの概要
クラスから継承されたフィールド org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
DEFAULT_EXCEPTION_ATTRIBUTE
クラスから継承されたフィールド org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
logger
インタフェースから継承されたフィールド org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
コンストラクタの概要
-
メソッドの概要
修飾子とタイプメソッド説明protected org.springframework.web.servlet.ModelAndView
doResolveException
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, Exception ex) Performs exception handling.protected void
setExceptionCode
(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Sets exception code inHttpServletRequest
andHttpServletResponse
header.void
setExceptionCodeAttribute
(String exceptionCodeAttribute) Sets the value for exception Code Attribute name.void
setExceptionCodeHeader
(String exceptionCodeHeader) Sets the header name to set exception code in the response header.void
setExceptionCodeResolver
(ExceptionCodeResolver exceptionCodeResolver) Sets the object for resolving exception code.protected void
setExceptionInfo
(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Sets the exception informationprotected void
setResultMessages
(Exception ex, jakarta.servlet.http.HttpServletRequest request) Sets result messagevoid
setResultMessagesAttribute
(String resultMessagesAttribute) Sets the attribute name used for storing result message in request scope andFlashMap
.クラスから継承されたメソッド org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
addStatusCode, applyStatusCodeIfPossible, determineStatusCode, determineViewName, findMatchingViewName, getDepth, getModelAndView, getModelAndView, getStatusCodesAsMap, setDefaultErrorView, setDefaultStatusCode, setExceptionAttribute, setExceptionMappings, setExcludedExceptions, setStatusCodes
クラスから継承されたメソッド org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
addMappedHandlerClass, buildLogMessage, getMappedHandlerClasses, getOrder, hasHandlerMappings, logException, prepareResponse, preventCaching, resolveException, setMappedHandlerClasses, setMappedHandlerPredicate, setMappedHandlers, setOrder, setPreventResponseCaching, setWarnLogCategory, shouldApplyTo
-
コンストラクタの詳細
-
SystemExceptionResolver
public SystemExceptionResolver()
-
-
メソッドの詳細
-
setExceptionCodeAttribute
Sets the value for exception Code Attribute name.This value is used as the attribute name to set exception code in request scope and
FlashMap
. Calling this method overwrites the default value"exceptionCode"
.
Ifnull
or blank or space is set, then exception code will not be set in request scope andFlashMap
whensetExceptionCode(Exception, HttpServletRequest, HttpServletResponse)
is called.- パラメータ:
exceptionCodeAttribute
- Attribute name of the exception code to be set in request scope andFlashMap
.
-
setExceptionCodeHeader
Sets the header name to set exception code in the response header.Calling this method overwrites the default value
"X-Exception-Code"
.
Ifnull
or blank or space is set, then exception code will not be set in the response header whensetExceptionCode(Exception, HttpServletRequest, HttpServletResponse)
is called..- パラメータ:
exceptionCodeHeader
- Attribute name of the exception code to be set in the response header.
-
setResultMessagesAttribute
Sets the attribute name used for storing result message in request scope andFlashMap
.Calling this method overwrites the default value
"resultMessages"
.
Ifnull
or blank or space is set, thenResultMessages
will not be set in request scope andFlashMap
whensetResultMessages(Exception, HttpServletRequest)
is called.- パラメータ:
resultMessagesAttribute
- Attribute name used for storing result message in request scope andFlashMap
.
-
setExceptionCodeResolver
Sets the object for resolving exception code.If not set, exception code will not be set in request scope and response header when
setExceptionCode(Exception, HttpServletRequest, HttpServletResponse)
is called.- パラメータ:
exceptionCodeResolver
- Exception code resolution object.
-
doResolveException
protected org.springframework.web.servlet.ModelAndView doResolveException(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler, Exception ex) Performs exception handling.Decides the View and resolves the Model necessary for display of View.
- オーバーライド:
doResolveException
クラス内org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
- パラメータ:
request
-HttpServletRequest
response
-HttpServletResponse
handler
- Request handlerex
- Exception- 関連項目:
-
SimpleMappingExceptionResolver.doResolveException(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception)
-
setExceptionInfo
protected void setExceptionInfo(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Sets the exception informationSets exception information in
HttpServletRequest
andHttpServletResponse
.- パラメータ:
ex
- Exceptionrequest
-HttpServletRequest
response
-HttpServletResponse
-
setExceptionCode
protected void setExceptionCode(Exception ex, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Sets exception code inHttpServletRequest
andHttpServletResponse
header.Sets exception code in
HttpServletRequest
andHttpServletResponse
header. If exceptionCodeAttribute isnull
or blank or space is set, then exception code is not set.- パラメータ:
ex
- Exceptionrequest
-HttpServletRequest
response
-HttpServletResponse
-
setResultMessages
Sets result messageSets result message in
HttpServletRequest
(FlashMap
)- パラメータ:
ex
- Exceptionrequest
-HttpServletRequest
-