form based login, possible with Vaadin?


I have a Vaadin application with has FORM-based login. The login form is currently an plain HTML file, which I want to replace with a Vaadin UI.
I wrote the Class, see below. In the web.xml, I have:

User Authentication


When calling the new login-form directly the Loginform is displayed correctly. However, when being called in the containers login process, Vaadin is not booted, no Loginform is displayed. I made the “/VAADIN” directory available without login.
Whats worng? Has anyone made successful FORM-based login with a Vaadin form?


User Authentication


[font=Courier New]
public class VAuthUI extends UI {

protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout layout = new VerticalLayout();

    final TextField name = new TextField("email:");
    final PasswordField pwd = new PasswordField("pwd:");

    Button button = new Button("login");
    button.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            String loginurl = String.format("j_security_check?j_username=%s&j_password=%s", name.getValue(),

    layout.addComponents(name, pwd, button);


@WebServlet(urlPatterns = "/vauth/*", name = "VAuthUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = VAuthUI.class, productionMode = false)
public static class VAuthUIServlet extends VaadinServlet {


Hello, there’s a good article about JAAS and Vaadin
in the docs
. There’s also a couple of example projects in git, like
this one
, that you can take a look. At the
of the referred git project there are other useful references too. Hope it helps!