关于遍历Enum并添加到Map
来源:11-2 卖家商品-修改表单提交

南船座
2019-11-05
是这样的 有一些数据比如product_category是单独作为表建立的
在管理系统前端下拉框页面对应的填充数据非常好获取
像下面就直接获取到
List<ProductCategory> productCategoryList = productCategoryService.findAll();
map.put("productInfo",productInfo);
页面遍历就行
<div class="form-group">
<label for="productStock">所属类目</label>
<select name="categoryType" id="categoryType" class="form-control">
<#list productCategoryList as list>
<option value="${list.categoryId}">${list.categoryName}系列</option>
</#list>
</select>
</div>
但是像productStatus,payStatus 这样都是enum中维护的
怎么遍历enum并添加到Map 没什么思路
廖师兄可以给我个思路嘛(百度查也没看到很靠谱的)
写回答
1回答
-
直接添加到map里呀,由freemarker遍历
00
相似问题