I am using the following class to validate a form submission described here:
public class example form {@ undetermined public intensity height; Public string payload; }
When I do bindFromRequest () the mandatory obstacle is ignored. However, it works when I change the primitive type into a box type:
public class exampleForm {@interpreted public integer height; Public string payload; }
Is Bean Validation not working with primitive types? Explanation is easy: the database allows zero values, and not the primitive type.
@ mandatory
checks that if object
is zero the first step is no more interval.
Place both models and forms in the form of the rule of using integer
instead of int
and you will always work your validator as expected.
No comments:
Post a Comment