Reputation: 1
I try to create new user using form in register.html (registration process is included in UserController). In String registrationPost, there should be object newUser containing datas from form (username, password, sex, role).
When I use newUser.toString(), it shows everything except username (for example: 'PRINTED newUser: UserForm{username='null', password='mypassword', userSex=MALE, userRole=ADMIN}')
What can I do to get also username from form? Why everything is sent except one field? Please, help me, guuuuys!
Links to project:
Template: https://github.com/ToTomki/getinpoland/blob/master/src/main/resources/templates/user/register.html
Upvotes: 0
Views: 118
Reputation: 8311
You have a problem in UserForm.java
public void setUsername(String username) {
this.username = this.username;
}
Should be:
public void setUsername(String username) {
this.username = username;
}
Upvotes: 3