It looks as though the ButtonTag and SubmitTag do not allow you to do this.

Therefore, you have a few other options.

1.  Use HTML along with the message tag...

<INPUT type="submit" name="btnSubmit" id="btnSubmit" value="<html:message
key="myBundleKey"/>">

2. Write your own custom tag.  You could extend the SubmitTag and over-ride
the getValue() call to retrieve a resoure bundle key.

3.  Last resort: Retrieve the bundle key through the message resources class
and place it into a script variable.
     Then place the script variable in the custom tag...
     This is ugly, so I would not do this unless you have a good reason to.

MessageResources bundle =
      (MessageResources)
pageContext.getServletContext().getAttribute(Action.MESSAGES_KEY);
String myValueRetrievedFromBundle = bundle.getMessage("myKey");
<html:submit property="btnSubmit" value="<%= myValueRetrievedFromBundle
%>"/>

(The code may not be exactly right.. I have not implemented this myself)

HTH,
    Pete


Neil Blue wrote:

> Hello,
>
> I am planning a struts app and I would like to know please if there is a
> way to set the text of a submit button, based on a key from the
> ApplicationResources.properties file.
>
> Thank you
>
> Neil Blue
begin:vcard 
n:;
x-mozilla-html:FALSE
org:<BR><IMG SRC="http://www.irista.com/logo/irista.gif";><BR><BR><FONT Color=#000080><FONT SIZE=2><B>Bringing Vision to Your Supply Chain
adr:;;;;;;
version:2.1
end:vcard

Reply via email to