當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalValidatorFactoryBean.setValidationMessageSource方法代碼示例

本文整理匯總了Java中org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.setValidationMessageSource方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalValidatorFactoryBean.setValidationMessageSource方法的具體用法?Java LocalValidatorFactoryBean.setValidationMessageSource怎麽用?Java LocalValidatorFactoryBean.setValidationMessageSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.validation.beanvalidation.LocalValidatorFactoryBean的用法示例。


在下文中一共展示了LocalValidatorFactoryBean.setValidationMessageSource方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: validator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
/**
 * Custom validator.
 * @param messageSource {@link MessageSource}
 * @return de {@link Validator}
 */
@Bean
public Validator validator(MessageSource messageSource) {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(messageSource);
    return factory;
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:12,代碼來源:BeheerWebApplication.java

示例2: getValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Override
public Validator getValidator() {
	LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
	validator.setValidationMessageSource(messageSource);

	return validator;
}
 
開發者ID:edylle,項目名稱:pathological-reports,代碼行數:8,代碼來源:PathologicalReportsApplication.java

示例3: getValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();
    localValidatorFactoryBean.setProviderClass(org.hibernate.validator.HibernateValidator.class);
    localValidatorFactoryBean.setValidationMessageSource(messageSource());
    return localValidatorFactoryBean;
}
 
開發者ID:numsg,項目名稱:spring-boot-seed,代碼行數:8,代碼來源:WebConfig.java

示例4: defaultValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
/** BeanValidationメッセージのUTF-8に対応したValidator。 */
@Bean
LocalValidatorFactoryBean defaultValidator(MessageSource message) {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(message);
    return factory;
}
 
開發者ID:jkazama,項目名稱:sample-boot-micro,代碼行數:8,代碼來源:ApplicationConfig.java

示例5: localValidatorFactoryBean

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean localValidatorFactoryBean() throws ClassNotFoundException {
	LocalValidatorFactoryBean result = new LocalValidatorFactoryBean();
	result.setProviderClass(Class.forName("org.hibernate.validator.HibernateValidator"));
	result.setValidationMessageSource(this.messageSource());
	return result;
}
 
開發者ID:shilongdai,項目名稱:bookManager,代碼行數:8,代碼來源:RootApplicationContextConfig.java

示例6: getValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Override
public Validator getValidator() {
    LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
    validator.setValidationMessageSource(messageSource());
    return validator;
}
 
開發者ID:swri-robotics,項目名稱:bag-database,代碼行數:7,代碼來源:WebMvcConfig.java

示例7: createValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
public static Validator createValidator() {
  LocaleContextHolder.setLocale(Locale.ENGLISH);
  ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
  messageSource.setFallbackToSystemLocale(false);
  messageSource.setBasenames("validation");
  messageSource.setDefaultEncoding("utf8");

  LocalValidatorFactoryBean localValidator = new LocalValidatorFactoryBean();
  localValidator.setValidationMessageSource(messageSource);
  localValidator.afterPropertiesSet();
  return localValidator;
}
 
開發者ID:puncha,項目名稱:petclinic,代碼行數:13,代碼來源:TestUtil.java

示例8: validator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
/**
 * Validator bean that is used during Hibernate annotation validation. 
 * This validator bean makes it possible to resolve the error messages defined within the message source files.
 *
 * @return the local validator factory bean
 */
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean();
    validatorFactoryBean.setValidationMessageSource(messageSource());
    return validatorFactoryBean;
}
 
開發者ID:andju,項目名稱:findlunch,代碼行數:13,代碼來源:Beans.java

示例9: defaultValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
/** BeanValidationメッセージのUTF-8に対応したValidator。 */
@Bean
public LocalValidatorFactoryBean defaultValidator(MessageSource message) {
    LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
    factory.setValidationMessageSource(message);
    return factory;
}
 
開發者ID:jkazama,項目名稱:sample-boot-hibernate,代碼行數:8,代碼來源:ApplicationConfig.java

示例10: localValidatorFactoryBean

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Override
protected LocalValidatorFactoryBean localValidatorFactoryBean() {
  LocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean();

  validatorFactoryBean.setValidationMessageSource(messageKeyResolver);

  return validatorFactoryBean;
}
 
開發者ID:epam-debrecen-rft-2015,項目名稱:atsy,代碼行數:9,代碼來源:CandidateControllerTest.java

示例11: getValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Override
public Validator getValidator()
{
	LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
	factory.setValidationMessageSource(messageSource);
	return factory;
}
 
開發者ID:sivaprasadreddy,項目名稱:jcart,代碼行數:8,代碼來源:WebConfig.java

示例12: validator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean();
	if (Boolean.parseBoolean(env.getProperty("validation.resolveErrorCodes"))) {
		validatorFactoryBean.setValidationMessageSource(messageSource);
	}
    return validatorFactoryBean;
}
 
開發者ID:lucamartellucci,項目名稱:bookshop-api,代碼行數:9,代碼來源:AbstractWebConfig.java

示例13: getValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
/**
 * Get Validator .
 *
 * @return validator
 */
@Override
public Validator getValidator() {
	LocalValidatorFactoryBean validator = new LocalValidatorFactoryBean();
	validator.setValidationMessageSource(messageSource);
	return validator;
}
 
開發者ID:pablogrela,項目名稱:members_cuacfm,代碼行數:12,代碼來源:WebMvcConfig.java

示例14: getValidator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
public Validator getValidator() {
	LocalValidatorFactoryBean factory = new LocalValidatorFactoryBean();
	ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
	messageSource.setBasename("/WEB-INF/messages/validation");
	if (environment.acceptsProfiles("embedded")) {
		messageSource.setCacheSeconds(0);
	}
	factory.setValidationMessageSource(messageSource);
	return factory;
}
 
開發者ID:mqprichard,項目名稱:spring-greenhouse-clickstart,代碼行數:11,代碼來源:WebConfig.java

示例15: validator

import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; //導入方法依賴的package包/類
@Bean
public Validator validator() {
    final LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean();

    localValidatorFactoryBean.setValidationMessageSource(messageSource());

    return localValidatorFactoryBean;
}
 
開發者ID:martinlau,項目名稱:unidle-old,代碼行數:9,代碼來源:I18NConfiguration.java


注:本文中的org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.setValidationMessageSource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。