File tree 2 files changed +11
-9
lines changed
src/main/java/ru/mystamps/web/support/spring/boot 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 38
38
DispatcherServletContext .class ,
39
39
ThymeleafViewResolverInitializingBean .class ,
40
40
JettyServletContainerCustomizer .class ,
41
- ErrorPagesServletContainerCustomizer .class
41
+ ErrorPagesCustomizer .class
42
42
})
43
43
public class ApplicationBootstrap {
44
44
Original file line number Diff line number Diff line change 20
20
import org .springframework .context .annotation .Configuration ;
21
21
import org .springframework .http .HttpStatus ;
22
22
23
- import org .springframework .boot .context .embedded .ConfigurableEmbeddedServletContainer ;
24
- import org .springframework .boot .context .embedded .EmbeddedServletContainerCustomizer ;
25
23
import org .springframework .boot .web .servlet .ErrorPage ;
24
+ import org .springframework .boot .web .servlet .ErrorPageRegistrar ;
25
+ import org .springframework .boot .web .servlet .ErrorPageRegistry ;
26
26
27
27
import ru .mystamps .web .Url ;
28
28
29
29
@ Configuration
30
- public class ErrorPagesServletContainerCustomizer implements EmbeddedServletContainerCustomizer {
31
-
30
+ public class ErrorPagesCustomizer implements ErrorPageRegistrar {
31
+
32
32
@ Override
33
- public void customize (ConfigurableEmbeddedServletContainer container ) {
34
- container .addErrorPages (new ErrorPage (HttpStatus .FORBIDDEN , Url .FORBIDDEN_PAGE ));
35
- container .addErrorPages (new ErrorPage (HttpStatus .NOT_FOUND , Url .NOT_FOUND_PAGE ));
36
- container .addErrorPages (new ErrorPage (Exception .class , Url .INTERNAL_ERROR_PAGE ));
33
+ public void registerErrorPages (ErrorPageRegistry registry ) {
34
+ registry .addErrorPages (
35
+ new ErrorPage (HttpStatus .FORBIDDEN , Url .FORBIDDEN_PAGE ),
36
+ new ErrorPage (HttpStatus .NOT_FOUND , Url .NOT_FOUND_PAGE ),
37
+ new ErrorPage (Exception .class , Url .INTERNAL_ERROR_PAGE )
38
+ );
37
39
}
38
40
39
41
}
You can’t perform that action at this time.
0 commit comments