File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes message resource for value property in html:radio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "message resource for value property in html:radio" Watch "message resource for value property in html:radio" New topic
Author

message resource for value property in html:radio

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
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

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: message resource for value property in html:radio
 
Similar Threads
To iterate HashMap in struts
problem with "html:radio"
html:radio
html:radio
Radio Button