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