Using Struts2, I have a very simple radio tag like following
<s:radio label="correctOption" name="correctAnswer" list="
#{'1':'1','2':'2','3':'3','4':'4'}" value="questionVo.correctAnswer"/>
questionVo.correctAnswer
returns 2
. So I want the second radio button to be preselected but it is not happening. I even tried:
<s:radio label="correctOption" name="correctAnswer" list="
#{'1':'1','2':'2','3':'3','4':'4'}" value="%{1}"/>
But that does not work either.
What am I doing wrong?