jsp接收到controller传来的list集合 怎么把list集合里的值添加到动态生成的下拉列表,求救。。。。急急急

controller代码如下:
prizeLevelVos:是前台动态生成的下拉列表需要的
compPrizeVos:是前台需要的数据
@RequestMapping(value = "", method = RequestMethod.GET)
public String compIndex(Model model,Long id){
   List<PrizeLevelVo> prizeLevelVos=compPrizeService.findAllLevel();
    List<CompPrizeVo> compPrizeVos=compPrizeService.findAll();
    model.addAttribute("compPrizeVos",compPrizeVos);
    model.addAttribute("prizeLevelVos",prizeLevelVos);   
    return "admin/competion/compArrange/comp-plan";
}
 
这是前台代码,动态生成的一组下拉列表 生成效果如下: 我想把后台传来的那个数据填充到这几个控件里。

 
<div>
   
    <hr/>
    <form class="form-horizontal form-bordered form-label-stripped form-validation"
               action="${ctx}/admin/sys/notify-message/edit" method="post" modelAttribute="compPrizeVo"
               data-editrulesurl="${ctx}/admin/util/validate?clazz=${clazz}">
        <input type="hidden"  name="id"  value="${compVo.id}" />
        <div class="form-body">
            <c:forEach var="prizeLevelVo" items="${prizeLevelVos}" varStatus="i">
                <div class="row">
                    <input type="hidden" name="id" value="${prizeLevelVo.id}">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label">是否设置${prizeLevelVo.level}</label>
                            <div class="controls">
                                <select style="width: 100%;height:30px;border-color: #e5eaeb" name="prizeLevel_id">
                                    <option value=""  selected="selected">不设置${prizeLevelVo.level}</option>
                                    <option value="${prizeLevelVo.id}">设置${prizeLevelVo.level}</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label">${prizeLevelVo.level}人数</label>
                            <div class="controls">
                                <input type="number" name="number" class="form-control" />
                                <span class="help-block">请填写具体的数字或百分比 如:10 10%</span>
                            </div>
                        </div>
                    </div>
                </div>
            </c:forEach>

        </div>
        <div class="form-actions">
            <button class="btn default"  style="float: right" type="button" >返回</button>
            <button class="btn green"  style="float: right" type="submit" >保存</button>
        </div>
    </form>
</div>

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页