How does Spring boot internationalize form validation @ Validated customize the resource folder?

Spring boot form validation @ Validated message internationalization resource files must be placed in resources/ValidationMessages.properties by default.

now I want to put the resource file in resources/i18n/validation/message.properties . How can I modify it?

found some information on the Internet and tried the following code, but it still didn"t work

@Configuration
public class ValidationConfig {

    @Bean
    public Validator getValidator() {
        ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
        messageSource.setBasename("i18n/validation/message.properties");

        LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
        validator.setValidationMessageSource(messageSource);

        return validator;
    }

}
Mar.09,2021

this can be configured

@Configuration
public class ValidationConfig {

    @Bean
    public Validator getValidator() {
        Validator validator = Validation.byDefaultProvider().
        configure().
        messageInterpolator(new ResourceBundleMessageInterpolator(new PlatformResourceBundleLocator("i18n/validation/message"))).
        buildValidatorFactory().getValidator();
        return validator;
    }

}

messageSource.setBasename ("i18n/validation/message.properties");
changed to:
messageSource.setBasename ("i18n/validation/message");

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c02b-2c2e9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c02b-2c2e9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?