commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig McClanahan <>
Subject Re: [resources] 1.0.0 Release Candidate 1
Date Mon, 28 Nov 2005 01:49:03 GMT
On 11/27/05, Niall Pemberton <> wrote:
> A couple of questions I had on the resources API:
> 1) I was wondering why TimeZone is include in the Resources's content
> read methods? Is there a use case, for example, for giving west coast
> Americans a different message to east coast?

Some of the format options for displaying times take a time zone parameter
(so that it can be included in the emitted string).  Simply pass null if it
doesn't matter to you.

2) A couple of possible suggestions for inclusion in the Message interface:
> 2.1) Struts has "non resource" messages where the message contains the
> actual message text, rather than a key to a resource - is it worth
> adding an "isResource()" method to Message?

I guess I'm not seeing the difference ... "resources" in the name of the
package was intended to support the retrieval of localized string messages
or non-string resources that correspond to a key.

2.2) Its been requested in Struts that the Message object include the
> name of the Resources it comes from - that way Messages can contain
> messages from multiple resources. Is it worth adding a
> "getResourcesName()" method to the Message interface?

Why not have a property of type Resources so you can refer to it directly,
rather than inventing a new identifier?

It would also be worth thinking through whether one can easily configure
Resources instances with a dependency injection framework ...



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message