I'm modifying a project from Spring In Action by Walls. The project is chapter six's thymeleaf mvc project. I'm adding a confirm password field to the registration form which is backed by a Spitter Object. I add validation to the project to check for the length of the password field and to check that the password and confirmPassword fields match. The Spitter form backing object is
The SpitterController is
The registrationForm is
I have a message resource bundle for Spring-manage messages, messages.properties:
And a ValidationMessages.properties for the JSR 303 and Hibernate Validator messages:
The message validation seems to work well except for one issue. When I force a password mismatch, I see something like the following (see attached png file):
Please fix the following error(s)
Your passwords don't match. Please try again
Instead of the single "Your passwords don't match. Please try again." message, I also see "spitter.password.mismatch.message" as a message and can't figure out why.
expectation is the root of all heartache - shakespeare. tiny ad:
Devious Experiments for a Truly Passive Greenhouse!