title: Autowire ViewResolver in Spring MVC
body: <p>For some reason I'm not able to Autowire the <code>ViewResolver</code>:</p>
  
  <pre><code>@Component
  public class JsonMultipleViewFactory
  {
      @Autowired
      private ViewResolver viewResolver;
  
      // ...
  }
  </code></pre>
  
  <p>viewResolver is <code>null</code>.</p>
  
  <p>The class <code>JsonMultipleViewFactory</code> is Autowired in a spring controller:</p>
  
  <pre><code>@Controller
  public class HomeController
  {
      @Autowired
      private JsonMultipleViewFactory jsonMultipleViewFactory;
  
      // ...
  }
  </code></pre>
  
  <p>I've created a <a href="https://github.com/MintTwist/ViewResolver-test" rel="nofollow">github repository</a> containing a very small example reproducing the problem. </p>
  
  <p>Can anyone help me?</p>
  
  <p>Thank you.</p>