<select name="parentId">
<option value="">顶级分类</option>
[#list categoryList as category]
<option value="${category.id}"[#if category.id == categoryBean.pid] selected[/#if]>
[#if category.grade != 0]
[#list 1..category.grade as i]
[/#list]
[/#if]
${category.name}
</option>
[/#list]
</select>
转载于:https://www.cnblogs.com/laihnhai/p/11164529.html