I have a portlet that uses spring mvc and when the portal is in spanish and in the controller I try to use the messageSource.getMessage it returns latin characters as weird chars.
MessageSource def in application context:
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames" value="classpath:messages"/>
<property name="defaultEncoding" value="UTF-8"/>
</bean>
Def in the controller:
@Autowired
public void setMessageSource(MessageSource messageSource) {
this.messageSource = messageSource;
}
When I try the following it returns the weird chars:
messageSource.getMessage("messagekey", null, request.getLocale());
It seems like it's ignoring the UTF-8 encoding. Any ideas?