前后端传递参数是靠model为载体传递的。
model.addAttribute("channel",channel); 也就两个参数前面是参数名 后面的是值对象
在页面中使用也是简单
<select name="channelId" id="channelId" class="input-xlarge">
<option value="" name=""></option>
<c:if test="${orgChannelDealer.channelId!=null}">
<option selected="selected" value="${orgChannelDealer.channelId}">${orgChannelDealer.channelName}</option>
</c:if>
<c:forEach items="${channel}" var="channelD">
<option value="${channelD.id}">${channelD.channelName}</option>
</c:forEach>
</select>
本文详细介绍了前后端如何通过model作为载体进行参数传递的过程。在Java Web应用中,通过设置model属性来绑定前端页面的选择框数据,实现了动态加载下拉列表选项的功能。

1764

被折叠的 条评论
为什么被折叠?



