This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

message resource for value property in html:radio

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get the value property of html:radio from message resource and it does not work. It displays the bean:message as string rather than retrieve the value for the provided key.

how to get the corresponding message resource value?

value="<bean:message key='disp.pr.1' bundle = 'dispmessage'>"
[ February 25, 2007: Message edited by: shah rah ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's generally not a good idea to attach a message resource key to the value of a radio button. The reason for this is that if you do so the value could change depending on the language used. Since you use that value to mean something in your program or your database, having it change depending on the language is usually a bad thing. It's fine for the label to change based on the language, but the value shouldn't change.

This is one of the reasons Struts has not provided an easy or convenient means of doing this. Embedding one Struts tag as an attribute of another is not supported, so the method you're trying simply won't work. Here's one way to do it, though:


[ February 26, 2007: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic