title: Spring JSF integration: how to inject a Spring component/service in JSF managed bean?
body: <p>I understand that a managed bean works like a controller, because your only task is "link" the View Layer with Model. </p>
  
  <p>To use a bean as a managed bean I must declare <code>@ManagedBean</code>annotation, doing that I can communicate JSF with bean directly. </p>
  
  <p>If I want to inject some component (from Spring) in this managedBean I have two possibles ways:</p>
  
  <ol>
  <li><p>Choose the property in ManagedBean (like "BasicDAO dao") and declare <code>@ManagedProperty(#{"basicDAO"})</code> above the property. Doing it, i'm injecting the bean <code>"basicDAO"</code> from Spring in ManagedBean. </p></li>
  <li><p>Declared @Controller in ManagedBean Class, then i'll have <code>@ManagedBean</code> and <code>@Controller</code> annotations, all together. And in property <code>"BasicDAO dao"</code> i must use <code>@Autowired</code> from Spring.</p></li>
  </ol>
  
  <p>Is my understanding correct?</p>