You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Should we add this advice to the class documentation?
BTW. For my original problem I've refactored the legacy initializer and plugged it directly into spring-boot framework.
I will say, that your framework significantly reduced boiler-plate Spring/Servlet components in my system. Thanks for a job well done.
-Alex
philwebb
changed the title
Implement Ordered interface in SpringBootServletInitializer.
Document @Ordered interface use with SpringBootServletInitializer.
Dec 9, 2014
If a legacy web application need to register objects with
Servlet
framework beforeSpringBootServletInitializer.onStartup
, it can implement it's ownWebApplicationInitializer
and provide the precedence through theOrdered
interface.SpringServletContainerInitializer
sorts all discoveredWebApplicationInitializers
throughAnnotationAwareOrderComparator
class. In case if theWebApplicationInitializer
does not implementOrdered
interface or is not annotated with@Order
annotation, it is assignedLOWEST_PRECEDENCE
.I think it is better to add
Ordered
implementation toSpringBootServletInitializer
and assign default precedence to0
.This issue came as a work around after regression of #2070 failed
The text was updated successfully, but these errors were encountered: