Class ErrorPageViewResolver

java.lang.Object
com.irurueta.authserver.authorization.api.web.error.ErrorPageViewResolver
All Implemented Interfaces:
org.springframework.boot.webmvc.autoconfigure.error.ErrorViewResolver

@Component public class ErrorPageViewResolver extends Object implements org.springframework.boot.webmvc.autoconfigure.error.ErrorViewResolver
Chooses the error page Spring Boot's BasicErrorController renders for a browser: the error template with a generic text picked from the status only, and the branding. The model the controller offers (timestamp, path, exception, ...) is deliberately not passed on, so the page never shows a stack trace, an exception message, the requested path or anything else that could leak internals. Clients that do not accept HTML get the controller's JSON body, which spring.web.error.include-* keeps to the timestamp, the status and its reason phrase.
  • Field Details

  • Constructor Details

    • ErrorPageViewResolver

      public ErrorPageViewResolver()
  • Method Details

    • resolveErrorView

      public org.springframework.web.servlet.ModelAndView resolveErrorView(jakarta.servlet.http.HttpServletRequest request, org.springframework.http.HttpStatus status, Map<String,Object> model)
      Resolves the error page of a status.
      Specified by:
      resolveErrorView in interface org.springframework.boot.webmvc.autoconfigure.error.ErrorViewResolver
      Parameters:
      request - the forwarded request.
      status - status of the failed request.
      model - model offered by the error controller; not used, so none of its details reach the page.
      Returns:
      the error view, with the message key and the branding, answered with the status.