Spring: message, Message not found by code for locale 'en_US'
This is what I added to my spring-servlet.xml
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="classpath:application"/>
</bean>
and my application.properties file is inside src / main / resources folder but I am getting this exception
SEVERE: Servlet.service() for servlet [MVC-Dispatcher] in context with path [/MVCLayer] threw exception [javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code 'Login_Username' for locale 'en_US'.] with root cause
javax.servlet.jsp.JspTagException: No message found under code 'Login_Username' for locale 'en_US'.
at org.springframework.web.servlet.tags.MessageTag.doEndTag(MessageTag.java:200)
Please help what is wrong with the config
+3
Sharique
source
to share
1 answer
You should use value="application"
if you put your properties file inside a foldersrc/main/resources
And of course, make sure the file application.properties
contains a line that starts withLogin_Username=
+6
mavroprovato
source
to share