The back-end transmits multiple sets of data, and the front-end c tag is parsed

As shown in the figure above, there are multiple filter categories of data. This data is transmitted from the back-end to the front-end through the configuration items. Since it is multiple sets of data of the same structure type, using list storage is bound to be the last data to cover all the previous data. So here the backend needs to use

map for multiple sets of data storage values

 The data obtained at this moment is for the actual acquisition of multiple sets of data

{"品类":[{"id":8,"sid":5,"value":"黑色","sort":0},{"id":9,"sid":5,"value":"灰色","sort":0},{"id":10,"sid":5,"value":"藏青色","sort":0},{"id":11,"sid":5,"value":"紫色","sort":0},{"id":12,"sid":5,"value":"粉色","sort":0},{"id":13,"sid":5,"value":"宝蓝色","sort":0},{"id":14,"sid":5,"value":"白色","sort":0},{"id":15,"sid":5,"value":"其他","sort":0}],"品牌":[{"id":2,"sid":3,"value":"STB","sort":0},{"id":3,"sid":3,"value":"VBC","sort":0},{"id":4,"sid":3,"value":"SCABAL","sort":0},{"id":5,"sid":3,"value":"ethomas","sort":0}],"年份":[{"id":28,"sid":2,"value":"17/18","sort":0},{"id":29,"sid":2,"value":"16/17","sort":0}],"季节":[{"id":6,"sid":4,"value":"春夏","sort":0},{"id":7,"sid":4,"value":"秋冬","sort":0}],"成分":[{"id":16,"sid":6,"value":"羊毛","sort":0},{"id":17,"sid":6,"value":"羊绒","sort":0},{"id":18,"sid":6,"value":"丝毛麻","sort":0},{"id":19,"sid":6,"value":"棉","sort":0},{"id":20,"sid":6,"value":"亚麻","sort":0},{"id":21,"sid":6,"value":"其他","sort":0}],"场景":[{"id":22,"sid":7,"value":"职业装","sort":0},{"id":23,"sid":7,"value":"高档商务","sort":0},{"id":24,"sid":7,"value":"宴会","sort":0},{"id":25,"sid":7,"value":"婚礼","sort":0},{"id":26,"sid":7,"value":"休闲","sort":0},{"id":27,"sid":7,"value":"其他","sort":0}]}

  Then it is adjusted to the goodList interface for data traversal display, here is the traversal of the c tag

 

<div class="ylw-spLbSxConTop">
			<c:forEach items="${map }" var="ecSer">
				<div class="ylw-spLbSxConTopMk">
				<h3>${ecSer.key }</h3>
				<ul class="checkBox">
					<c:forEach items="${ecSer.value }" var="map">
						<li>${map.value }</li>
					</c:forEach>
				</ul>
				</div>
			</c:forEach>
		</div>

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325259417&siteId=291194637