Class ExtendedMappingExceptionResolver

All Implemented Interfaces:
Ordered, HandlerExceptionResolver

public class ExtendedMappingExceptionResolver extends SimpleMappingExceptionResolver
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 Details

    • MODEL_ATTR_REQUEST

      @Nonnull private static final String MODEL_ATTR_REQUEST
      Model attribute carrying HttpServletRequest.
      See Also:
    • MODEL_ATTR_RESPONSE

      @Nonnull private static final String MODEL_ATTR_RESPONSE
      Model attribute carrying HttpServletResponse.
      See Also:
    • MODEL_ATTR_SPRINGCONTEXT

      @Nonnull private static final String MODEL_ATTR_SPRINGCONTEXT
      Model attribute carrying WebApplicationContext.
      See Also:
    • MODEL_ATTR_ENCODER

      @Nonnull private static final String MODEL_ATTR_ENCODER
      Model attribute carrying the HTMLEncoder class.
      See Also:
    • viewModelExtenderFunction

      @Nullable private Function<javax.servlet.http.HttpServletRequest,Map<String,Object>> viewModelExtenderFunction
      Function to obtain extensions to view model.
  • Constructor Details

    • ExtendedMappingExceptionResolver

      public ExtendedMappingExceptionResolver()
      Constructor.
    • ExtendedMappingExceptionResolver

      public ExtendedMappingExceptionResolver(@Nullable Function<javax.servlet.http.HttpServletRequest,Map<String,Object>> extender)
      Constructor.
      Parameters:
      extender - function to obtain extensions to view model
  • Method Details