N G wrote the following on 7/12/2005 4:14 PM:
Hi,

Is it possible to use the resource properties for keys as well as
args? For example,

<bean:message key="test.val1" arg0="test.val2"/>

Properties:
test.val1=hello {0}
test.val2=world

So, what I am trying to accomplish is to have the above statement output:
hello world

However, it outputs:
hello test.val2

Not sure if you could nest bean:message, I'm guessing no, but I know a way around it using JSTL. (fmt:message acts the same as bean:message it will pull from your ApplicationResources)...


<fmt:message key='test.val2' var='fooBar'/>
<fmt:message key='test.val1'>
   <fmt:param value='${fooBar}'/>
</fmt:message>


If you decide to use JSTL fmt:message just remember to put something like this in your web.xml:

<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>ApplicationResources</param-value>
  </context-param>

(assumes ApplicationResources is your properties file found in root of classes.... at least the above works for me.. might be a better way)


--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to