vendredi 6 mars 2015

Spring Message Not Displaying

I am trying to do internationalization in Spring-MVC for the first time and I'm having what I assume to be a configuration issue. I have a NLS file that I named NLS_en.properties which I placed in my application's WEB-INF\classes directory. The file contains the following NLS string:



MSG_HELLO = Hello to the Internationalized World


In my application's servlet.xml file I've defined the following beans:



<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="WEB-INF/classes/NLS"/>
</bean>


In my JSP file I have the following tag:



<p><spring:message code="MSG_HELLO" text="You should not be seeing this text" />


When the JSP displays, of course, the message I see is the one I should not be seeing, so how do I have to configure my application so that I do see my HELLO message?


Aucun commentaire:

Enregistrer un commentaire