<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>classpath:i8n/contact</value>
<value>classpath:i8n/ui</value>
<value>classpath:i8n/ValidationMessages.properties</value>
</list>
</property>
<property name="cacheSeconds" value="10000" />
<property name="defaultEncoding" value="UTF-8"/>
<property name="useCodeAsDefaultMessage" value="true" />
</bean>
Ok, here's my spring messagesource config. Not the "useCodeAsDefaultMessage" setting. This means that any time a message is not found the requested code will be returned as is.
Ok, so let's assume the following validation message
value has to be between {min} and {max}
The MessageInterpolator starts processing this and recurses into the message. It hits the messageSource with 'min' and 'max'. Since these message keys don't exist, Spring returns 'min' and 'max' literally.
Resulting validation message
value has to be between min and max
|