The gender validation is not working. Even if no values are entered in the gender text field, the form is getting validated successfully without throwing any error.
Belo
1) All of the javax constraints include an implicit "or null" in their pass conditions. If you want to catch blanks you need to either add @NotNull
, or reconfigure the web binder to bind blank inputs to empty string instead of null.
2) <context:annotation-config />
does not turn on Spring 3 dispatcher servlet auto-config magic. You need to define your own validator bean if you do that. To enable everything to automagically work you need to use <mvc:annotation-driven />
.