Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.library.librarytest;
- import com.ejt.vaadin.loginform.DefaultVerticalLoginForm;
- import com.ejt.vaadin.loginform.LoginForm.LoginEvent;
- import javax.servlet.annotation.WebServlet;
- import com.vaadin.annotations.Theme;
- import com.vaadin.annotations.VaadinServletConfiguration;
- import com.vaadin.server.VaadinRequest;
- import com.vaadin.server.VaadinServlet;
- import com.vaadin.ui.UI;
- /**
- * This UI is the application entry point. A UI may either represent a browser window
- * (or tab) or some part of an HTML page where a Vaadin application is embedded.
- * <p>
- * The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
- * overridden to add component to the user interface and initialize non-component functionality.
- */
- @Theme("valo")
- @SuppressWarnings("serial")
- public class MyUI extends UI {
- @Override
- protected void init(VaadinRequest vaadinRequest) {
- DefaultVerticalLoginForm loginForm = new DefaultVerticalLoginForm();
- loginForm.addLoginListener((LoginEvent event) -> {
- System.err.println(
- "Logged in with user name " + event.getUserName() +
- " and password of length " + event.getPassword().length());
- });
- }
- @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
- @VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
- public static class MyUIServlet extends VaadinServlet {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement