wood burning stoves 2.0*
The moose likes Struts and the fly likes Application Resources.properties file format and uses 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 » Struts
Bookmark "Application Resources.properties file format and uses" Watch "Application Resources.properties file format and uses" New topic

Application Resources.properties file format and uses

Kris Ten

Joined: Feb 28, 2007
Posts: 11
I'm working on upgrading to Struts 1.3.5 in an application that was already built on some version of 1.1. I'm relatively new to Struts, and I was wondering if anyone could tell me about the ApplicationResources.properties files (message resource bundles, right?). I understand that they contain error messages, both packaged with Struts and application-specific, developer-created. However, is there any special syntax other than the standard

# Comment goes here
element.keyName=Your favorite value {0}, as always

Also, why was I getting warning messages that said that ApplicationResources_en.properties and ApplicationResources_en_US.properties were not found. I know that en is for "English" and US is... well, obvious, but why did I need them? And do I have to copy the code from the basic ApplicationResources.properties file into each of those, or reference that file in some way?

Any insight would be greatly appreciated

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
No, there's nothing special about the ApplicationResources.properties file. It uses the standard rules for a Java ResourceBundle.

The warning message is nothing to be concerned about. All it's saying is that Struts first tried to find a language-specific version of the properties file, and since it didn't find one, it used the default, which is ApplicationResources.properties.

If you want to find out more about how to make language-specific properties files in Struts, see this link.

Consultant, Sima Solutions
Kris Ten

Joined: Feb 28, 2007
Posts: 11
Thanks for your help on this and my LocalStrings question. I'm sure there will be more to come

subject: Application Resources.properties file format and uses
Similar Threads
provide localisation for weblayer as well as remote layer
ApplicationResource properties
Struts validation not displaying error messages