SAR-303 xml validator验证框架

// 配置文件详解

<mvc:annotation-driven validator="validator" />
 <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"> 
     <property name="providerClass" value="org.hibernate.validator.HibernateValidator"/> 
     <property name="validationMessageSource" ref="messageSource"/> 
 </bean> 
  
 <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> 
     <property name="basenames"> 
         <list> 
             <value>classpath:ywblValidationMessages</value>
         </list> 
     </property> 
     <property name="useCodeAsDefaultMessage" value="false"/> 
     <property name="defaultEncoding" value="UTF-8"/> 
     <property name="cacheSeconds" value="120"/> 
 </bean>

posted @ 2016-08-25 10:57  随风而逝,只是飘零  阅读(223)  评论(0编辑  收藏  举报