Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

message resources with buttons?

 
Bloo Barton
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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" />' >
 
Gigi Kent
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic