Spring MVC Custom Validator
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package com.baeldung.model;
|
||||
|
||||
import com.baeldung.customvalidator.ContactNumberConstraint;
|
||||
|
||||
public class ValidatedPhone {
|
||||
|
||||
@ContactNumberConstraint
|
||||
private String phone;
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user