File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes Resource bundle properties file in Spring MVC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Resource bundle properties file in Spring MVC" Watch "Resource bundle properties file in Spring MVC" New topic

Resource bundle properties file in Spring MVC

Rina Magro
Ranch Hand

Joined: May 25, 2006
Posts: 63
Hi all
I am trying to configure the Resource Bundle properties file in Spring MVC with no succcess.
I am using Tomcat on Eclipse IDE. In my xml file i tried this:

and tried creating a file under my build/classes , under WEB-INF and under various places but when i try to load a message through
im always getting this ???greeting??? (not finding the message)
Any suggestions please cos I am quite new to Spring MVC
thanks lots
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Did you try under WEB-INF/classes ? And what it the name of your property file ?

[My Blog]
All roads lead to JavaRanch
Aditya Jha
Ranch Hand

Joined: Aug 25, 2003
Posts: 227


I assume 'fmt' means JSTL taglib with URI as ''.

JSTL is independent of Spring MVC, and hence, a resource-bundle loaded via Spring MVC can not be directly referred using JSTL. You can use 'fmt' taglib to load the resource-bundle also, in which case 'fmt:message' will work.

However, I would recommend replacing


where 'spring' prefix is for Spring MVC taglib with URI as ''.

A resource-bundle loaded via Spring MVC can easily be accessed using Spring MVC taglibs.

Another point... for simplicity, consider changing


in the configuration.

Best regards,

- Aditya Jha
ranjinie Nama

Joined: Jul 14, 2009
Posts: 5
<fmt:message key="greeting"/> tag will work. when you update your messages in a messagebundle.

Stop your server and restart or redeploy your project.

???......??? will go away and show the real message
It is sorta covered in the JavaRanch Style Guide.
subject: Resource bundle properties file in Spring MVC
Similar Threads
Problem in Externalizing the Configuration
Warnings with message resource
Spring MVC i18n problem
Spring DM versus JSR-291
spring inside eclipse