js 遍历EL表达式 list对象

无法直接通过"${topicList}"获取对象,需要通过<c:forEach>获取list里的对象:

var topicListArry = new Array(); 
    <c:forEach items="${topicList}" var="t"> 
        var topicObj = {};
        topicObj.id = '${t.id}';
        topicObj.title = '${t.title}';
        topicListArry.push(topicObj);
    </c:forEach> 

猜你喜欢

转载自www.cnblogs.com/lijianda/p/10224270.html
今日推荐