1、现象
operamasks为前台界面,封装及其好,只接收后台固定格式数据,且请求都在JS文件中。
2、问题
controller无法给出js规定的格式数据,又必须传输。
3、解决
采用jsp中转:controller====>jsp=====>js
jsp中
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="jspButtonList" style="display:none;">
<c:forEach items="${jspButtonList}" var="p">
${p.btnId},
</c:forEach>
</div>
js中
$("#jspButtonList").text()