You probably want to pick up a book on Spring. It will go in much more detail. I reccommend Spring In Action. It explains how the application context is loaded and how beans are initialized and wired
To answer your question, if you have a standalone app that you want to use spring in, you have to load the application context from the main method yourself. So, in your main method you do something like this
This call starts the application context, loads the xml, parses the xml, creates the beans, initializes the beans before returning. Basically, the container and beans are loaded for you from the constructor
If you are writing a webapp using spring, generally, you add something like this in your web.xml
Basically, you declare a
servlet of type org.springframework.web.servlet.DispatcherServlet to start on startup. This servlet will load the Application Context on startup. It will do exactly what your main method would do.