我是Vaadin的新手,我正在尝试理解其在vaadin书中阅读的复杂架构。 我想用不同的浏览器验证它的时间响应(IE11和Chrome)
所以我写了这个小应用程序(vaadin教程地址簿):
public class MyVaadinUI extends Application implements Button.ClickListener, Property.ValueChangeListener, ItemClickEvent.ItemClickListener {
//-----------------------------------------------------
// IMPLEMENTATIONS
//-----------------------------------------------------
@Override
public void init() {
System.out.println("Calling init() method...");
long starttime = System.currentTimeMillis();
buildMainLayout();
// get the execution time from start to end
System.out.println("took time-->" + (System.currentTimeMillis() - starttime));
}
这是结果日志:
Calling init() method...
took time-->2
Calling init() method...
took time-->2
Calling init() method...
took time-->4
我无法理解为什么init方法被执行3次。
亲切的问候