0

嗨,看看我在 jsp 中的代码。

    <s:iterator value="answeredquestions" status="status" var="question">
  <fieldset>
    <legend><s:property value="Question"/></legend>
    <s:property value="QuestionNumber"/>    
    <table><s:radio label="Answer" name="answeredquestions[%{#status.index}].UserAnswer" list="AnswersOptions" /></table>
   </fieldset>
   </s:iterator>
      <

列表似乎工作正常但是在第一个列表项中,单选按钮不会出现在字段集中。

4

1 回答 1

1

请参阅有关主题的文档http://struts.apache.org/2.x/docs/themes-and-templates.html。默认情况下,Struts2 使用xhtml主题。在这个主题中,元素被放在表格单元格中。您可以通过在标签中指定theme="simple"属性来更改它。注意:如果您使用simple主题,您将丢失字段错误。

于 2012-11-06T13:41:32.640 回答