Validate partial Modal using Spring @Valid annotation

后端 未结 2 1348
暖寄归人
暖寄归人 2020-12-21 17:03

I have a User Modal

public class RegisterUser {

    @Size(min = 2, max = 30)
    private String fname;

    @Size(min = 2, max = 30)
    private String lnam         


        
2条回答
  •  礼貌的吻别
    2020-12-21 18:05

    You can use Validation Groups (for different scenarios) and Spring's @Validated annotation to specify which group you want to use

提交回复
热议问题