Skip to content

documentation example bug in "Customizing ConfigurableEmbeddedServletContainer directly" #2258

Closed
@BorisDaich

Description

@BorisDaich

see here http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-customizing-configurableembeddedservletcontainerfactory-directly

in sample code:

@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.setPort(9000);
    factory.setSessionTimeout(10, TimeUnit.MINUTES);
    factory.addErrorPages(new ErrorPage(HttpStatus.404, "/notfound.html");
    return factory;
}

the line

factory.addErrorPages(new ErrorPage(HttpStatus.404, "/notfound.html");

should be

factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/notfound.html"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions