Re: Need help w. ResourceBundle
From: Oscar kind (oscar_at_danwa.net)
Date: 08/28/04
- Next message: Larry Barowski: "Re: Warning about JFileChooser filters and thread safety"
- Previous message: Sudsy: "Re: Need help w. ResourceBundle"
- In reply to: Mr. Steve R. Burrus: "Need help w. ResourceBundle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 28 Aug 2004 23:45:08 +0200
Mr. Steve R. Burrus <burrus1@swbell.net> wrote:
> Hi all, I am working on a simple "HelloWorldExample.java" servlet, and there
> are 2 lines of code in it: "ResourceBundle rb =
> ResourceBundle.getBundle("LocalStrings",request.getLocale());",
> and it compiles okay for me, but when I try to execute it in my browser, I
> get all sorts of "MissingResourceExceptions" java exceptions!!
As specified in another post, you put the properties files in
WEB-INF/classes. This is good.
Now, assume the the ResourceBundle is called "LocalStrings", the Locale
specified is Dutch, and the default locale is US english. Then according
to the API, the code looks for the first of these files it can find:
- LocalStrings_nl_NL.propertyies
- LocalStrings_nl.properties
- LocalStrings_en_US.propertyies
- LocalStrings_en.properties
- LocalStrings.properties
Does either one of the files needed exist? Does the last one (always have
a default)?
If the file does exist, a MissingResourceException is thrown when a given
key doesn't exist. So that's a second place you may want to look.
-- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2
- Next message: Larry Barowski: "Re: Warning about JFileChooser filters and thread safety"
- Previous message: Sudsy: "Re: Need help w. ResourceBundle"
- In reply to: Mr. Steve R. Burrus: "Need help w. ResourceBundle"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|