java.lang.IllegalArgumentException: Failed to register servlet with name 'dispatcher'.Check if there is another servlet registered under the same name
问题 My initializer class public class HomeServlet extends AbstractAnnotationConfigDispatcherServletInitializer{ @Override protected Class<?>[] getRootConfigClasses() { return null; } @Override protected Class<?>[] getServletConfigClasses() { return new Class<?>[]{SpringContextConfig1.class}; } @Override protected String[] getServletMappings() { return new String[] {"/home"}; } } Configuration Class @ComponentScan(basePackages={"spittr.controllers"}) @Configuration @EnableWebMvc public class