Java Code Examples for org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#setValidationMessageSource()

The following examples show how to use org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#setValidationMessageSource() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomMessageSourceConfiguration.java    From tutorials with MIT License 6 votes vote down vote up
@Bean
public LocalValidatorFactoryBean getValidator() {
    LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
    bean.setValidationMessageSource(messageSource());
    return bean;
}
 
Example 2
Source File: ServletConfiguration.java    From airsonic-advanced with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Validator getValidator() {
    // need to get constraint violation message codes translated
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(ms);
    return factory;
}
 
Example 3
Source File: HibernateValidateConfig.java    From spring-boot-api-project-seed with Apache License 2.0 5 votes vote down vote up
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
    localValidatorFactoryBean.setProviderClass(HibernateValidator.class);
    localValidatorFactoryBean.setValidationMessageSource(messageSource());
    return localValidatorFactoryBean;
}
 
Example 4
Source File: WebConfig.java    From pizzeria with MIT License 5 votes vote down vote up
@Bean
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
    bean.setValidationMessageSource(messageSource());
    return bean;
}
 
Example 5
Source File: ApplicationConfig.java    From sample-boot-micro with MIT License 5 votes vote down vote up
/** BeanValidationメッセージのUTF-8に対応したValidator。 */
@Bean
LocalValidatorFactoryBean defaultValidator(MessageSource message) {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(message);
    return factory;
}
 
Example 6
Source File: ApplicationConfig.java    From sample-boot-hibernate with MIT License 5 votes vote down vote up
/** BeanValidationメッセージのUTF-8に対応したValidator。 */
@Bean
public LocalValidatorFactoryBean defaultValidator(MessageSource message) {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(message);
    return factory;
}
 
Example 7
Source File: WebConfig.java    From jcart with MIT License 5 votes vote down vote up
@Override
public Validator getValidator()
{
	LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
	factory.setValidationMessageSource(messageSource);
	return factory;
}
 
Example 8
Source File: ApplicationConfig.java    From ddd-java with MIT License 5 votes vote down vote up
/** BeanValidationメッセージのUTF-8に対応したValidator。 */
@Bean
public LocalValidatorFactoryBean defaultValidator(MessageSource message) {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(message);
    return factory;
}
 
Example 9
Source File: ApplicationConfig.java    From ZTuoExchange_framework with MIT License 4 votes vote down vote up
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    validator.setValidationMessageSource(getMessageSource());
    return validator;
}
 
Example 10
Source File: ApplicationConfig.java    From ZTuoExchange_framework with MIT License 4 votes vote down vote up
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    validator.setValidationMessageSource(getMessageSource());
    return validator;
}
 
Example 11
Source File: ApplicationConfig.java    From ZTuoExchange_framework with MIT License 4 votes vote down vote up
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    validator.setValidationMessageSource(getMessageSource());
    return validator;
}
 
Example 12
Source File: ApplicationConfig.java    From ZTuoExchange_framework with MIT License 4 votes vote down vote up
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    validator.setValidationMessageSource(getMessageSource());
    return validator;
}
 
Example 13
Source File: ValidationConfig.java    From accelerator-initializer with Mozilla Public License 2.0 4 votes vote down vote up
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(this.messageSource);
    return factory;
}
 
Example 14
Source File: WebConfig.java    From jcart with MIT License 4 votes vote down vote up
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(messageSource);
    return factory;
}
 
Example 15
Source File: WebMvcConfig.java    From thymeleafexamples-layouts with Apache License 2.0 4 votes vote down vote up
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    validator.setValidationMessageSource(messageSource());
    return validator;
}
 
Example 16
Source File: WebConfig.java    From spring-rest-server with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean();
    validatorFactoryBean.setValidationMessageSource(messageSource);
    return validatorFactoryBean;
}