user985351 user985351 - 1 year ago 204
Java Question

Spring: No message found under code for locale 'en_US'


<bean id="messageSource" class="">
<property name="basenames">

I have under /src/

registerForm.passwordNotMatch=Password does not match.

This is line of code is bringing up the error:

binding.addError(new FieldError(REGISTER_FORM, "passwordNotMatch", messageSource.getMessage("registerForm.passwordNotMatch", null, locale)));

Error: No message found under code 'registerForm.passwordNotMatch' for locale 'en_US'.

What might be wrong?

Answer Source

does it work if you change to:



I had the experience that if using ReloadableResourceBundleMessageSource, in jsp will not find the properties file. adding classpath: before the basename solved my problem.

Well even though was my project managed by maven, I think you can give it a try anyway.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download