org.shoulder.web.common.ErrorPageConfig Maven / Gradle / Ivy
package org.shoulder.web.common;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
/**
* 错误页配置
*
* @author lym
*/
public class ErrorPageConfig implements ErrorPageRegistrar {
@Override
public void registerErrorPages(ErrorPageRegistry registry) {
ErrorPage error404 = new ErrorPage(HttpStatus.NOT_FOUND, "/404.html");
ErrorPage error500 = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/500.html");
registry.addErrorPages(error404, error500);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy