Sharique
Sharique

Reputation: 859

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

Upvotes: 5

Views: 20549

Answers (1)

mavroprovato
mavroprovato

Reputation: 8372

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=

Upvotes: 6

Related Questions