struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruth, Brice" <>
Subject Re: i18n with keys from DB
Date Mon, 26 Apr 2004 13:29:40 GMT
The easiest think to do is use the struts-bean-el taglib, where you can 
do something like this:

<c:set var="myDbVar" value="my_db_value"/>
<bean:message key="${myDbVar}"/>

Basically, store the key in a locally scoped variable (can be page, 
session, or request) and then reference that variable in your 'key' 

We do this all the time for pulling a key from an XML file (or from a 
Tiles attribute) and then using the key for bean:message


Axel Seinsche wrote:

>Hi all,
>I think I have a common problem, but couldn't find any solution in the archive of this
list or with Google.
>All I want to have is i18n where keys come from the DB. My DB contains a table where I
can read the keys from. With this key I want to do a lookup in my properties file. How can
I do this? Until now I failed to something like
><bean:message key="<c:out value="my_db_value" />" />
>I hope this problem was solved before and someone can help me.
>I thougt about storing my values language dependent in the DB, but for several reasons
I don't like this approach! 
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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