I am using the annotation validation as below:
public String processRegistration(@Valid Spitter spitter, Errors errors,
Model model) {
I see two points in your code that may cause de problem.
1) Instead of use the correct namespace .
2) On your @Controller change your functions parameters from:
public String processRegistration(@Valid Spitter spitter, Errors errors,
Model model) {
if (errors.hasErrors()) {
return "registerForm";
}
...
To:
public String processRegistration(@ModelAttribute("spitter") @Valid Spitter spitter, BindingResult result) {
if (result.hasErrors()) {
return "registerForm";
}
...
Try it! ;)