If you can use jstl, you can also try

                <fmt:message key="field.lookupbutton">
                        <fmt:param>
                                <fmt:message key="customer.label"/>
                        </fmt:param>
                </fmt:message>

Cheers,
Krishna


-----Original Message-----
From: Paul McCulloch [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 5:16 PM
To: 'Struts Users Mailing List'
Subject: RE: Using a key as an argument to bean:message


Thansk - that's ceryainly a lot neater. I keep forgetting that lots of tags
can have stuff defined in their body - I always seem to look at example
which have no body.
 
cheers,
 
Paul

-----Original Message-----
From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED]
Sent: 01 August 2003 12:47
To: [EMAIL PROTECTED]
Subject: Re: Using a key as an argument to bean:message



hi,
u can't send the key as the argument to the bean:message, though u might
want to consider this
<bean:define id="realValue" >
    <bean:message key="customer.label" />
 </bean:define>
<bean:message key="field.lookupbutton" arg0="<%=realLabel%>"/>

-- nagi

 
-------Original Message-------
 
From: Struts Users Mailing  <mailto:[EMAIL PROTECTED]> List
Date: Friday, August 01, 2003 05:00:41 PM
To: Struts Users Mailing List  <mailto:[EMAIL PROTECTED]>
(E-mail)
Subject: Using a key as an argument to bean:message
 
Hi,

Has anyone got any ideas on how to use a message key as an argument in a
bean:message call.

e.g. <bean:message key="field.lookupbutton" arg0Key="customer.label"/>

At the moment I am using a scriptlet to access the message resources and
assign the message for the argument to a page variable. e.g.

<%
org.apache.struts.util.MessageResources messages =
(org.apache.struts.util.MessageResources)request.getAttribute(org.apache.str
uts.Globals.MESSAGES_KEY);

String realLabel = messages.getMessage("customer.label");
%>

<bean:message key="field.lookupbutton" arg0="<%=realLabel%>"/>

This works but is a bit messy. 

Note that both keys are actually dynamic and come from nested beans on the
ActionForm - I can't just create a fixed composite message in my
application.properties.

thanks,

Paul


**************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you
are not the addressee indicated in this message (or responsible for delivery
of the message to such person), you may not copy or deliver this message to
anyone. In such case, you should destroy this message, and notify us
immediately. If you or your employer does not consent to Internet email
messages of this kind, please advise us immediately. Opinions, conclusions
and other information expressed in this message are not given or endorsed by
my Company or employer unless otherwise indicated by an authorised
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being
transmitted via electronic mail attachments we cannot guarantee that
attachments do not contain computer virus code. You are therefore strongly
advised to undertake anti virus checks prior to accessing the attachment to
this electronic mail. Axios Systems Ltd grants no warranties regarding
performance use or quality of any attachment and undertakes no liability for
loss or damage howsoever caused.


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


.

                        
____________________________________________________
 <http://www.incredimail.com/redir.asp?ad_id=309&lang=9>   IncrediMail -
Email has finally evolved -
<http://www.incredimail.com/redir.asp?ad_id=309&lang=9> Click Here 


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

Reply via email to