1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2016 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -113,18 +113,14 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
113
113
/**
114
114
* Delegate the {@code ServletContext} to any {@link WebApplicationInitializer}
115
115
* implementations present on the application classpath.
116
- *
117
116
* <p>Because this class declares @{@code HandlesTypes(WebApplicationInitializer.class)},
118
117
* Servlet 3.0+ containers will automatically scan the classpath for implementations
119
118
* of Spring's {@code WebApplicationInitializer} interface and provide the set of all
120
119
* such types to the {@code webAppInitializerClasses} parameter of this method.
121
- *
122
- * <p>If no {@code WebApplicationInitializer} implementations are found on the
123
- * classpath, this method is effectively a no-op. An INFO-level log message will be
124
- * issued notifying the user that the {@code ServletContainerInitializer} has indeed
125
- * been invoked but that no {@code WebApplicationInitializer} implementations were
126
- * found.
127
- *
120
+ * <p>If no {@code WebApplicationInitializer} implementations are found on the classpath,
121
+ * this method is effectively a no-op. An INFO-level log message will be issued notifying
122
+ * the user that the {@code ServletContainerInitializer} has indeed been invoked but that
123
+ * no {@code WebApplicationInitializer} implementations were found.
128
124
* <p>Assuming that one or more {@code WebApplicationInitializer} types are detected,
129
125
* they will be instantiated (and <em>sorted</em> if the @{@link
130
126
* org.springframework.core.annotation.Order @Order} annotation is present or
@@ -134,7 +130,6 @@ public class SpringServletContainerInitializer implements ServletContainerInitia
134
130
* that each instance may register and configure servlets such as Spring's
135
131
* {@code DispatcherServlet}, listeners such as Spring's {@code ContextLoaderListener},
136
132
* or any other Servlet API componentry such as filters.
137
- *
138
133
* @param webAppInitializerClasses all implementations of
139
134
* {@link WebApplicationInitializer} found on the application classpath
140
135
* @param servletContext the servlet context to be initialized
@@ -168,9 +163,8 @@ public void onStartup(Set<Class<?>> webAppInitializerClasses, ServletContext ser
168
163
return ;
169
164
}
170
165
166
+ servletContext .log (initializers .size () + " Spring WebApplicationInitializers detected on classpath" );
171
167
AnnotationAwareOrderComparator .sort (initializers );
172
- servletContext .log ("Spring WebApplicationInitializers detected on classpath: " + initializers );
173
-
174
168
for (WebApplicationInitializer initializer : initializers ) {
175
169
initializer .onStartup (servletContext );
176
170
}
0 commit comments