【发布时间】:2015-12-29 09:55:21
【问题描述】:
我使用 Spring Boot 和 Vaadin 为应用程序接口开发应用程序 Web。
我的问题是无法inyect控制器查看,应用程序启动正常,但是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?
谢谢。
【问题讨论】:
标签: spring-boot vaadin7 vaadin4spring