Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

This is what I have added in 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 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 on what is wrong with the configuration

like image 697
Sharique Avatar asked Apr 16 '15 16:04

Sharique


1 Answers

You should use value="application" if you place your properties file inside the src/main/resources folder

And of course make sure that the application.properties file contains a line that starts with Login_Username=

like image 157
mavroprovato Avatar answered Nov 15 '22 04:11

mavroprovato