I've got the following annotation:
@NotEmpty
@Documented
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = SupportedVideoUrlValida开发者_运维百科tor.class)
public @interface SupportedVideoUrl {
    String message() default "{cast.submission.error.video}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
    String value() default "";
}
It works OK except the i18n part. The post-validation error message is displayed as is. I do not know how to handle this...
If you have any ideas, thanks in advance for your help!
Rolf
Assuming you are using JSR-303 annontations, put a file ValidationMessages.properties at the root of your classpath containing:
cast.submission.error.video=Video URL is not supported.
this file is loaded as a ResourceBundle so if you need message for a different language add the language suffix to the file (eg ValidationMessages_de.properties for german translations).
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论