I want to know the purpose of below methods inside the class when the class extends AbstractAnnotationConfigDispatcherServletInitializer
protected Class[] getRootConfigClasses() { return new Class[0]; }
@Override
- protected Class[] getServletConfigClasses() { return new Class[] { testAPI.class }; } 3.@Override protected String[] getServletMappings() { return new String[] { "/" }; }
(1) wants a list of @Configuration (user) classes for creating a Root ApplicationContext and (2) wants a list of (user) classes for the AnnotationConfigWebApplicationContext.
So image you have several @Configuration classes coded somewhere, you can register them with: