Add helpful error message to DispServlet initializer

Issue: SPR-10168
This commit is contained in:
Rossen Stoyanchev 2013-01-21 14:41:31 -05:00
parent 0c56e86bfb
commit 902a136b6e
1 changed files with 5 additions and 0 deletions

View File

@ -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());