You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hani Hamandi <ha...@geotrust.com> on 2002/03/04 17:49:01 UTC

default key?

Folks,

Is there any way to tell <bean:message>, "if you can't find this key, then
use that key" ?

Here's what I would like to do:
For every property in my ApplicationResources, I would like to have a
default value, and a couple different texts for different contexts (in the
same language, English).
So I thought of this (so far theoretical) approach:
Here's how one property, "X.Y.Z" for example, would look like:

X.Y.Z=default text
A.X.Y.Z=different text A
B.X.Y.Z=different text B

What I want to achieve is:

Whenever I use <bean:message key = "A.X.Y.Z" />, if this key is not found,
then use the key "X.Y.Z" (the default value). And similarly, whenever I use
<bean:message key = "B.X.Y.Z" />, if this key is not found, then use the
"X.Y.Z".

Is there any way to do that?

Thanks!
Hani.









--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>