Class ExtendedMappingExceptionResolver
java.lang.Object
org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
net.shibboleth.shared.spring.error.ExtendedMappingExceptionResolver
- All Implemented Interfaces:
Ordered,HandlerExceptionResolver
Custom Spring exception to view mapper that populates the view model with data
obtained via an extension function.
As a default, the view model will include a reference to the active HttpServletRequest
and the HTMLEncoder class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringModel attribute carrying theHTMLEncoderclass.private static final StringModel attribute carryingHttpServletRequest.private static final StringModel attribute carryingHttpServletResponse.private static final StringModel attribute carryingWebApplicationContext.private final Function<HttpServletRequest,Map<String, Object>> Function to obtain extensions to view model.Fields inherited from class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
DEFAULT_EXCEPTION_ATTRIBUTEFields inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
loggerFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ModelAndViewdoResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) protected ModelAndViewgetModelAndView(String viewName, Exception ex, HttpServletRequest request) Methods inherited from class org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
addStatusCode, applyStatusCodeIfPossible, determineStatusCode, determineViewName, findMatchingViewName, getDepth, getModelAndView, getStatusCodesAsMap, setDefaultErrorView, setDefaultStatusCode, setExceptionAttribute, setExceptionMappings, setExcludedExceptions, setStatusCodesMethods inherited from class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver
buildLogMessage, getOrder, hasHandlerMappings, logException, prepareResponse, preventCaching, resolveException, setMappedHandlerClasses, setMappedHandlers, setOrder, setPreventResponseCaching, setWarnLogCategory, shouldApplyTo
-
Field Details
-
MODEL_ATTR_REQUEST
Model attribute carryingHttpServletRequest.- See Also:
-
MODEL_ATTR_RESPONSE
Model attribute carryingHttpServletResponse.- See Also:
-
MODEL_ATTR_SPRINGCONTEXT
Model attribute carryingWebApplicationContext.- See Also:
-
MODEL_ATTR_ENCODER
Model attribute carrying theHTMLEncoderclass.- See Also:
-
viewModelExtenderFunction
Function to obtain extensions to view model.
-
-
Constructor Details
-
ExtendedMappingExceptionResolver
public ExtendedMappingExceptionResolver()Constructor. -
ExtendedMappingExceptionResolver
public ExtendedMappingExceptionResolver(@Nullable Function<HttpServletRequest, Map<String, Object>> extender) Constructor.- Parameters:
extender- function to obtain extensions to view model
-
-
Method Details
-
doResolveException
protected ModelAndView doResolveException(@Nonnull HttpServletRequest request, @Nonnull HttpServletResponse response, @Nullable Object handler, @Nonnull Exception ex) - Overrides:
doResolveExceptionin classSimpleMappingExceptionResolver
-
getModelAndView
@Nonnull protected ModelAndView getModelAndView(@Nonnull String viewName, @Nonnull Exception ex, @Nonnull HttpServletRequest request) - Overrides:
getModelAndViewin classSimpleMappingExceptionResolver
-