Greetings. I have to iterate the values of radio buttons in a jsp page. But instead of the values to be printed in the jsp page, I want something else printed. For example the values could be numbers like 1, 2, 3 and what I want printed in the jsp page could be A, B, C like the following html radio button.
You can set up a hidden paramter in your jsp. <html:hidden property="hidden_variable" />
In your form class define setter, getters for hidden parameter. public String getHidden_variable() public void setHidden_variable(String hv)
Read this paramter in action class String string1 = (String)((MyForm)form).getHidden_variable();
This is assuming that your form has a method called getRadioValues() that returns a list of LabelValueBeans. Also, your form should have a property called radioProp so the submittal will save the values. If you need a radio value to be selected by default, extend LabelValueBean with a selected property, and use logic:equal to determine whether or not to display "checked" in the input tag.