Class CustomErrorController
java.lang.Object
org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController
org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController
edu.ucsb.cs156.frontiers.controllers.CustomErrorController
- All Implemented Interfaces:
org.springframework.boot.web.servlet.error.ErrorController
@Controller
public class CustomErrorController
extends org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController
Custom error controller that replaces the default white label error page with a more
user-friendly error page.
-
Constructor Summary
ConstructorsConstructorDescriptionCustomErrorController
(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.ServerProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndView
errorHtml
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles error requests and returns a custom error page.Methods inherited from class org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController
error, getErrorAttributeOptions, getErrorProperties, isIncludeBindingErrors, isIncludeMessage, isIncludePath, isIncludeStackTrace, mediaTypeNotAcceptable
Methods inherited from class org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController
getBooleanParameter, getErrorAttributes, getErrorsParameter, getMessageParameter, getPathParameter, getStatus, getTraceParameter, resolveErrorView
-
Constructor Details
-
CustomErrorController
public CustomErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes, org.springframework.boot.autoconfigure.web.ServerProperties properties)
-
-
Method Details
-
errorHtml
@RequestMapping(produces="text/html") public org.springframework.web.servlet.ModelAndView errorHtml(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles error requests and returns a custom error page.- Overrides:
errorHtml
in classorg.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController
- Parameters:
request
- the HTTP requestresponse
- the HTTP response- Returns:
- the name of the error view template
-