您的位置:首页 > 产品设计 > UI/UE

前端页面接收request.setAttribute("变量名", 变量值)传的值

2017-07-10 16:15 471 查看
1.js中使用

<script>

var a='${变量名}';//注意变量名一定要和setAttribute中设置的变量名相同

</script>

2.html中使用

${变量名}

示例:

<table id="treedg" data-options="toolbar:'#tb'" >
<c:if test="${fieldMaxLevel!=0}">
<c:if test="${frozenFields!=null}">
<!-- 冻结列一定要在列表最左侧,并且不可跳跃式冻结,单层次列,不具有合并属性 -->
<thead  data-options="frozen:true">
<tr>
<c:forEach var ="item" items='${frozenFields}'>
<c:choose>
<c:when test="${item.isCollapse>0}">
<th data-options="field:'${item.field}',width:${item.width},halign:'${item.halign}',align:'${item.align}',formatter:${item.formatterFun},styler:${item.stylerFun}" >${item.title}  <i id="${item.field}" class="fa-minus-square-o" style="cursor:pointer" onclick="collapse(this,'${item.collapseFields}')"></i></th>
</c:when>
<c:otherwise>
<th data-options="field:'${item.field}',width:${item.width},halign:'${item.halign}',align:'${item.align}',formatter:${item.formatterFun},styler:${item.stylerFun}" >${item.title}</th>
</c:otherwise>
</c:choose>
</c:forEach>
</tr>
</thead>
</c:if>
<thead>
<c:forEach begin="1" end="${fieldMaxLevel}" var="i">
<tr>
<c:forEach var ="item" items='${commonFields}'>
<c:if test="${item.fieldLevel==i}">
<c:choose>
<c:when test="${item.isCollapse>0}">
<th data-options="field:'${item.field}',width:${item.width},halign:'${item.halign}',align:'${item.align}',formatter:${item.formatterFun},styler:${item.stylerFun}" rowspan="${item.rowspan}" colspan="${item.colspan}">${item.title}  <i id="${item.field}" class="fa-minus-square-o" style="cursor:pointer" onclick="collapse(this,'${item.collapseFields}')"></i></th>
</c:when>
<c:otherwise>
<th data-options="field:'${item.field}',width:${item.width},halign:'${item.halign}',align:'${item.align}',formatter:${item.formatterFun},styler:${item.stylerFun}" rowspan="${item.rowspan}" colspan="${item.colspan}">${item.title}</th>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
</tr>
</c:forEach>
</thead>
</c:if>
</table>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jsp cif java cforEach cwhen
相关文章推荐