SpringBoot ---- Form Validation

1, in the process corresponding to the parameter controller layer, passed in front of the object or a parameter coupled @Valid annotation, to participate in the form BindResult

2, the member variable limits also need to verify that the member variables plus @ Min, @ Max, @ Length, @ NotNull other restrictions comment. For example: @Min (value = 18, message = "minors into the binary")

Guess you like

Origin www.cnblogs.com/elian91/p/11226960.html