Inject controller in Vaadin view Spring Boot

Hi everyone,

I developing an application web with Spring Boot and Vaadin for the application interface.

My problem is can’t inyect the controller to view, the application starts OK, but the bean is it null in execution.

My controller:

@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;
}


My view:

@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);

In the LoginView the bean VioewController is null.

How I can inyect the bean in the view?

Thanks.

Share the spring application config,