Class EnduranceTrioErrorController

java.lang.Object
com.endurancetrio.app.common.web.EnduranceTrioErrorController
All Implemented Interfaces:
org.springframework.boot.webmvc.error.ErrorController

@Controller public class EnduranceTrioErrorController extends Object implements org.springframework.boot.webmvc.error.ErrorController
The EnduranceTrioErrorController handles requests forwarded by the servlet container to the /error path after an unhandled exception or servlet-level error.

This controller ensures that all error pages rendered by the application use the same Thymeleaf layout (head, navbar, footer) as regular content pages.

  • Constructor Details

    • EnduranceTrioErrorController

      @Autowired public EnduranceTrioErrorController(MessageService messageService, AppProperties appProperties)
  • Method Details

    • handleError

      @RequestMapping(value="/error", method={GET,POST}) public org.springframework.web.servlet.ModelAndView handleError(@NonNull jakarta.servlet.http.HttpServletRequest request)
      Handles requests to the /error path, populating the model with error attributes from the servlet container's error dispatch.
      Parameters:
      request - the current HTTP request containing error attributes
      Returns:
      a ModelAndView with the error page