2012-03-26 9 views
1

デフォルトのValidationMessages.propertiesをotherに変更しようとしています。しかし、私はそれを取得しません。Hibernate ValidatorでValidationMessages.propertiesをどのように変更しますか?

マイセットアップ:

春です。 text.propertiesとtex_XX.propertiesで

<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> 
    <property name="basenames"> 
     <list> 
      <value>text</value> 
      <value>error</value> 
     </list> 
    </property> 
</bean> 

<bean name="validator" 
     class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"> 
    <property name="validationMessageSource"> 
     <ref bean="messageSource"/> 
    </property> 
</bean> 

edit.profile.password.size=Password must be between {min} and {max} 

注釈の例。

@Size(min=4, max=8, message="{edit.profile.password.size}") 

答えて

0

異なる検証プロバイダを使用する場合でも、クラスパスにHibernate Validator 4.1以降が必要です。

関連する問題