Advertisement
Gigi95

UI file

Apr 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1. package com.library.librarytest;
  2.  
  3. import com.ejt.vaadin.loginform.DefaultVerticalLoginForm;
  4. import com.ejt.vaadin.loginform.LoginForm.LoginEvent;
  5. import javax.servlet.annotation.WebServlet;
  6.  
  7. import com.vaadin.annotations.Theme;
  8. import com.vaadin.annotations.VaadinServletConfiguration;
  9. import com.vaadin.server.VaadinRequest;
  10. import com.vaadin.server.VaadinServlet;
  11. import com.vaadin.ui.UI;
  12.  
  13. /**
  14.  * This UI is the application entry point. A UI may either represent a browser window
  15.  * (or tab) or some part of an HTML page where a Vaadin application is embedded.
  16.  * <p>
  17.  * The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
  18.  * overridden to add component to the user interface and initialize non-component functionality.
  19.  */
  20. @Theme("valo")
  21. @SuppressWarnings("serial")
  22. public class MyUI extends UI {  
  23.    
  24.     @Override
  25.     protected void init(VaadinRequest vaadinRequest) {
  26.        
  27.        DefaultVerticalLoginForm loginForm = new DefaultVerticalLoginForm();
  28. loginForm.addLoginListener((LoginEvent event) -> {
  29.     System.err.println(
  30.             "Logged in with user name " + event.getUserName() +
  31.                     " and password of length " + event.getPassword().length());
  32.        });
  33.    
  34.    
  35.     }
  36.     @WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
  37.     @VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
  38.     public static class MyUIServlet extends VaadinServlet {
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement