19. ARCHITECTURE
USER SESSION
▸ 모든 화면 구성요서는 USER SESSION에 연결된다. 서블릿이 종료되
도, 구성요소는 was 서버에 존재하게 된다. vaadin의 heartbeat체
크가 살아 있는한……
▸ 그래서 l4,l7 round robin X X X
▸ tomcat session clustering이 방법이라하지만, 구현이 복잡해짐,
▸ sticky session이 가장 쉬운 해결책
22. UI-VIEW-NAVIGATOR
@Theme("valo")
public class MyUI extends UI {
private Navigator navigator;
@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final VerticalLayout main = new VerticalLayout();
final HorizontalLayout menu = new HorizontalLayout();
main.setMargin(true);
layout.addComponents(menu, main);
setContent(layout);
navigator = new Navigator(this, main);
navigator.addView("", new DefaultView());
navigator.addView("view1", new View1());
navigator.addView("view2", new View2());
Button view1Button = new Button("Goto View1");
view1Button.addClickListener(event -> navigator.navigateTo("view1"));
Button view2Button = new Button("Goto View2");
view2Button.addClickListener(event -> navigator.navigateTo("view2"));
menu.addComponents(view1Button, view2Button);
}
}
23. UI-VIEW-NAVIGATOR
LISTENERS AND EVENTS
Button view1Button = new Button("Goto View1");
view1Button.addClickListener(event -> navigator.navigateTo("view1"));
Button view2Button = new Button("Goto View2");
view2Button.addClickListener(event -> navigator.navigateTo("view2"));