This question has already been answered:
Hello, I need help with utf-8 encoding. I am working on a Spring MVC project. I connected a bin:
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="defaultEncoding" value="UTF-8"/> <property name="basenames" value="classpath:messages,classpath:ValidationMessages"/> </bean> Also files for localization
messages_ru.properties, files for localization of validation
ValidationMessages.properties on the jsp page I use:
<spring:message code="firstname"/> <form:errors path="firstname" cssClass="error"></form:errors> and everything works fine, but there is one problem - all that is in ValidationMessages.properties in Russian - I get on jsp :
BRIDE BRIDE BRAND BRACKET
and с messages_ru.properties everything is well displayed in Russian.
It blows up the brain, what's the problem? I "googled" everything I could, also tried to add the "bin" validator and do a ref to messageSource - messageSource success.
Thanks for attention.
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>at the beginning of the jsp file. - Sergey Gornostaev