commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Jouravlev <jmi...@gmail.com>
Subject Re: [RESOURCES] Messages vs. regular properties
Date Thu, 01 Dec 2005 22:55:04 GMT
On 11/30/05, Niall Pemberton <niall.pemberton@gmail.com> wrote:
> On 12/1/05, Michael Jouravlev <jmikus@gmail.com> wrote:
> > Do I miss something or messages and resources are incompatible? From
> > my point of view they are basically the same thing. Differences are:
> >
> >  * resources can be anything, messages can be only strings
> >  * messages take parameters to stick into placeholders
>
> If were talking in Commons Resources terms then Resources and Message
> are different things - a Message is the representation of the key to a
> resource - Resources are what resolve those keys into the resource
> object.

Umm... So you are saying that I should use Message(s) for both error
messages and regular localised strings. Makes sense. How about
Messages to implement List? I know it sucks to implement all List
methods, but JSTL calls get("bla") for lists if I use something like
${list["bla"]} in my JSP page. I think it would really simplify
things, because now I have to write
<li><i>
  <%= ((Messages)session.getAttribute("MSGS")).getMessage("label.user") %>
</i></li>
which is OK, but too long. Or maybe you can suggest a better way to
display messages?

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message