Hi Stu,
If you look in the JavaDocs, there are a number of different ways to get the bean by its bean ID. The key is to get hold of the ApplicationContext, which is the way to access the beans.
The most direct way is as follows:
I use this approach in a lot of my
unit tests.
Another way I've done this is in web applications where I'm hooking Spring components into an existing web application. In this case, I use the ContextLoaderListener to configure the beans when the web application context is loaded. Then, I can use the following snippet:
I hope this helps,
Mark