Login Form - Autofill is not working


i do have a simple app login.

Textfield for name
Passwordfield for password
Button to login

My Browser Firefox or Chrome do not recognize neither the name nor the passwordfield. I like to have this feature so that the user can save there combination to a passwordmanager.

I use java only so i already tried this:
username.getElement().setAttribute(“name”, “username”);
password.getElement().setAttribute(“name”, “password”);