I have spring mvc application with complete annotations. Where is the best place to add @componentScan? Let me know any of these recommended
- class that extends AbstractAnnotationConfigDispatcherServletInitializer?
- class that extend WebMvcConfigurationSupport
- class that extend WebSecurityConfigurerAdapter
I placed in 2 without security and workign fine. When I added security, I got problem with security config not able to find userdetails service. Then I moved to 3. I found other issues with security and put code to just reuturn null instead of securityconfig object from getRootConfigClasses(). Then I got issues of controllers not found. I am able to fix it to put componenentscan in 2.
I just want to know any links and how it works. Is it ok to put @componentscan in all of these 3? Appreciate your help.