Given the following class
public class Website {
@NotNull
String owner:
@ValidUrl
String url;
}
When we validate that (e.g. using @Valid) and if Website.url does not respect my custom @ValidUrl constraint we'll get an constraint violation (e.g. "url is unreachable").
I was wondering if it is possible to ignore that validation if the user wants to.
Steps:
- Validate form for the 1st time
- Throw constraint violation and show it to the user
- User chooses "I know, add it anyway" and re-submit
- Validate form for the 2nd time, validating everything except @ValidUrl