Skip to content

Document @Ordered interface use with SpringBootServletInitializer. #2098

Closed
@apogrebnyak

Description

@apogrebnyak

If a legacy web application need to register objects with Servlet framework before SpringBootServletInitializer.onStartup, it can implement it's own WebApplicationInitializer and provide the precedence through the Ordered interface.

SpringServletContainerInitializer sorts all discovered WebApplicationInitializers through AnnotationAwareOrderComparator class. In case if the WebApplicationInitializer does not implement Orderedinterface or is not annotated with @Order annotation, it is assigned LOWEST_PRECEDENCE.

I think it is better to add Ordered implementation to SpringBootServletInitializer and assign default precedence to 0.

This issue came as a work around after regression of #2070 failed

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