posted 18 years ago
That's the whole point of autowiring ! You don't need to tell the container which beans to use. It will look for a bean whose type is SessionFactory, and another bean whose type is AnotherService, and wire them to MyServiceImpl.
Note that if Spring finds more than one bean of type SessionFactory or AnotherService, it will throw an exception. In this case, you will have to set the constructor args explicitly with the constructor-arg tag.