package com.zm.blog.config;import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;import org.springframework.boot.web.servlet.ErrorPage;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.http.HttpStatus;@Configurationpublic class ErrorPageConfig {@Beanpublic EmbeddedServletContainerCustomizer containerCustomizer() {return new EmbeddedServletContainerCustomizer() {public void customize(ConfigurableEmbeddedServletContainer container) {ErrorPage error400Page = new ErrorPage(HttpStatus.BAD_REQUEST, "/400");ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/404");ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500");container.addErrorPages(error400Page, error404Page, error500Page);}};}}