mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Add helpful error message to DispServlet initializer
Issue: SPR-10168
This commit is contained in:
+5
@@ -94,6 +94,11 @@ public abstract class AbstractDispatcherServletInitializer
|
||||
|
||||
ServletRegistration.Dynamic registration =
|
||||
servletContext.addServlet(servletName, dispatcherServlet);
|
||||
|
||||
Assert.notNull(registration,
|
||||
"Failed to register servlet with name '" + servletName + "'." +
|
||||
"Check if there is another servlet registered under the same name.");
|
||||
|
||||
registration.setLoadOnStartup(1);
|
||||
registration.addMapping(getServletMappings());
|
||||
registration.setAsyncSupported(isAsyncSupported());
|
||||
|
||||
Reference in New Issue
Block a user