0
我使用Spring Boot和Vaadin爲應用程序界面開發應用程序Web。Vaadin視圖中的注入控制器Spring Boot
我的問題是不能監視控制器查看,應用程序啓動正常,但該bean在執行中爲空。
我的控制器:
@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;
}
... ...
我的觀點:
@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);
在LoginView
的bean ViewController
爲空。
如何在視圖中檢查bean
?
謝謝。