title: Inject controller in Vaadin view Spring Boot
body: <p>I developing an application web with Spring Boot and Vaadin for the application interface.</p>
  
  <p>My problem is can't inyect the controller to view, the application starts OK, but the bean is it null in execution.</p>
  
  <p>My controller:</p>
  
  <pre><code>@Component
  public class ViewController {
  
  /** Inyección de Spring para poder acceder a la capa de datos.*/
  @Autowired
  private CommonSetup commonSetup;
  
  /**
   * This method gets the user from db.
   */
  public Temployee getUser(String username, String password) {
      Temployee empl = null;
      // get from db the user
      empl = commonSetup.getUserByUsernameAndPass(username, password);
  
      // return the employee found.
      return empl;
  }
  </code></pre>
  
  <p>...
     ...</p>
  
  <p>My view:</p>
  
  <pre><code>@Theme("login")
  @SpringUI
  public class LoginView extends CustomComponent implements View ,Button.ClickListener {
  
  /** The view controller. */
  @Autowired
  private ViewController   vContr;
  
  public LoginView() {
      setSizeFull();
  
     ...
     ...
  
     // Check if the username and the password are correct.
     Temployee empleado = vContr.getUser(username, password);
  </code></pre>
  
  <p>In the <code>LoginView</code> the <code>bean ViewController</code> is null.</p>
  
  <p>How I can inyect the <code>bean</code> in the view?</p>
  
  <p>Thanks.</p>