关于使用SSM整合在页面中的校验错误提示信息乱码问题解决

<!-- 校验错误信息配置文件 -->
<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>

猜你喜欢

转载自blog.csdn.net/DorAction/article/details/79181717
今日推荐