前端頁面接收request.setAttribute("變量名", 變量值)傳的值

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>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章