Hello,
I'm learning about bean validation. I have created simple form with username and password input fields which are bound through backing bean to model (User) properties username and password. I have marked them with annotation:
@Id
@NotNull(message="Username cannot be empty")
private String username;
@NotNull(message="Password cannot be empty")
private String password;
Now on the page with that form I've put <h:messages/>
inside <h:form>...</h:form>
. I submit empty form, I am redirected to the same page (I have return null in action method in backing bean) but no messages are being displayed. What am I doing wrong?