commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: [resources]ResourceBundle.getBundle
Date Tue, 18 Mar 2003 17:24:20 GMT

On Tue, 18 Mar 2003, george stewart wrote:

> Date: 18 Mar 2003 09:07:06 -0500
> From: george stewart <>
> Reply-To: Jakarta Commons Developers List <>
> To:
> Subject: [resources]ResourceBundle.getBundle
> In the messages class, there's static method:
>     public static Messages getMessages(String name)
> which does this:
> Resources resources = factory.getResources(name + ".LocalStrings");
> This doesn't work for ResourceBundle.getBundle on W2K with JDK 1.3.1_04.

The intent is that "name" be the fully qualified package name of the class
that you are in (so that you can localize all the error messages for that
package in a single file).  Struts uses a technique very similar to this
with no problems on Windows, so it would surprise me that this didn't work
(although I don't have a 1.3 JDK on my windows PC to check it right at the

If you have a reproducible failure case, could you please post it on a bug

You can file it against product "Commons" and component "Sandbox" -- just
be sure to include "[Resources]" in the summary description.

> You could use name of the form name + "_LocalStrings".
> Secondly, wouldn't users prefer an exception in this method instead of
> the silent failure?

I don't believe so.

The typical use case is something like this:

  package com.mycompany.mypackage;

  public class MyClass {

    private static Messages messages =

    public void myMethod() {
      if (something bad happened) {

Having to deal with an exception in the static initializer would be a real


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message