Well, I looked at a few tutorials regarding Spring dependency injection as well as MVC, but I still don't seem to understand how we can specifically create classes?
I mean, if, for example, I have a variable
@Autowired ClassA someObject;
How can I make Spring create someObject as an instance of class B that extends ClassA? for example someObject = new ClassB ();
I really donβt understand how this works in spring, does ContextLoaderListener do this automatically or do we need to create some kind of configuration class, where we determine exactly what Spring should instantiate these classes? (In this case, I did not see anything in the textbooks). If so, how do we indicate and what does it look like? And how do we configure it to work in web.xml, etc.
Arturas m
source share