<bean id="customerBinding" class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer">
<property name="validator" ref="validator">
</property>
</bean>
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="providerClass" value="org.hibernate.validator.HibernateValidator"
/>
<!--不設(shè)置則默認(rèn)為classpath下的 ValidationMessages.properties -->
<property name="validationMessageSource" ref="validatemessageSource" />
</bean>
<bean id="validatemessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:validatemessages" />
<property name="fileEncodings" value="utf-8" />
<property name="cacheSeconds" value="120" />
</bean>
參考資料:
http://www.cnblogs.com/whgk/p/7191152.html
https://my.oschina.net/shyloveliyi/blog/525252
標(biāo)簽:
- 版權(quán)所有:奇站網(wǎng)絡(luò) 轉(zhuǎn)載請(qǐng)注明出處
- 廈門奇站網(wǎng)絡(luò)科技有限公司,專業(yè)提供網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站建設(shè),小程序開發(fā),系統(tǒng)定制開發(fā)。
- 軟件開發(fā)咨詢熱線:吳小姐 13313868605