So far, I have used XML file for component-scan of my entire application. Then, to access bean(s) from Spring Container, I would do something like:
But then I learned that I can have class annotated with @ComponentScan that serves the same purpose.
So, instead of writing this in XML file:
, I can do this instead:
But I am stuck now. How do I access beans from Spring Container now? Because component-scan from XML is replaced with @ComponentScan, meaning I can't anymore do: