aspose file tools*
The moose likes Struts and the fly likes message resources with buttons? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "message resources with buttons?" Watch "message resources with buttons?" New topic
Author

message resources with buttons?

Bloo Barton
Ranch Hand

Joined: May 09, 2005
Posts: 63
Is there a way that I can add test from my MessageResources to a button using the Struts <html:button /> tag? I would like to be able to have my buttons' text support internationalization the same as the rest of the application.

-thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I don't believe the html:button tag accomodates this. However, my opinion is that the html:button doesn't really offer much in the way of added function.

I would just use a regular <input> tag like this:

<input name="button1" type="button" value="'<bean:message key="msg.button1" />' >


Merrill
Consultant, Sima Solutions
Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
Hi.
It is very simple
<html:button property="idmodule"><bean:message key="key_from_messages_resources"/></html:button>

This way you will have internationalized your button.
Bloo Barton
Ranch Hand

Joined: May 09, 2005
Posts: 63
Cornel Cc,

Thanks, that is exactly what I needed to know. I did not realize you could put the label for the button in between the opening and closing tag. It is not that way with the standard HTML <input> tag.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: message resources with buttons?
 
Similar Threads
Which layout to use?
Customizable buttons( see attached image) spring MVC
swing buttons
JButton with bad Labels
Simple: Turning A Program Into An Applet