<!-- 校验错误信息配置文件 -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<!-- 资源文件名-->
<property name="basenames">
<list>
<!-- 错误信息文件:CustomValidationMessages.properties -->
<value>classpath:CustomValidationMessages</value>
</list>
</property>
<!-- 解决中文乱码 -->
<property name="defaultEncoding" value="utf-8"/>
<!-- 资源文件编码格式 -->
<property name="fileEncodings" value="utf-8" />
<!-- 对资源文件内容缓存时间,单位秒 -->
<property name="cacheSeconds" value="120" />
</bean>
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<!-- 资源文件名-->
<property name="basenames">
<list>
<!-- 错误信息文件:CustomValidationMessages.properties -->
<value>classpath:CustomValidationMessages</value>
</list>
</property>
<!-- 解决中文乱码 -->
<property name="defaultEncoding" value="utf-8"/>
<!-- 资源文件编码格式 -->
<property name="fileEncodings" value="utf-8" />
<!-- 对资源文件内容缓存时间,单位秒 -->
<property name="cacheSeconds" value="120" />
</bean>