What's the minimal configuration needed to have the following class member to be initialized using the @Autowired
annotations:
public class A {
@Autowired
private B b;
// ...
}
When invoking A a = new A(), I'd like b
to be initialized from a predefined bean without the need to configure it in code.
Probably some files are needed: A.java, web.xml, spring-context.xml (for configuring B) and jars(spring and a jar containing B).
What's the minimal needed configuration and files content?