el取值

第一种:map取值

//查询所有可能性
Map<String,Object> map = new HashMap<>();
for(TransactionHistory history:historyList){
	String stageName = history.getStage();
	String value = (String) this.getServletContext().getAttribute(stageName);
	map.put(stageName, value);
}

request.setAttribute("possibilityMap", map);

<c:forEach items="${possibilityMap }" var="map">
	<c:if test="${hl.stage==map.key }">
		<td>${map.value }</td>
	</c:if>
</c:forEach>


第二种:list取值

TransactionHistoryService historyService = (TransactionHistoryService)ServiceFactory
		.getServiceProxy(new TransactionHistoryServiceImpl());		 
List<TransactionHistory> historyList = historyService.queryAllTransactionHistoryByTransactionId(id);

request.setAttribute("historyList", historyList);


<c:if test="${!empty historyList }">
	<c:forEach items="${historyList }" var="hl">
		<tr>
		    <td>${hl.stage }</td>
		    <td>${hl.amountOfMoney }</td>	
		    <td>${hl.expectedClosingDate }</td>
		</tr>
	</c:forEach>
</c:if>

第三种:实体类取值

// 查询交易基本信息
TransactionService tranService = (TransactionService)ServiceFactory
	.getServiceProxy(new TransactionServiceImpl());		
Transaction transaction = tranService.detailTransaction(id);

request.setAttribute("transaction", transaction);

<h3>${transaction.name } <small>¥${transaction.amountOfMoney }</small></h3>


第四种:单个数据取值


//查询交易基本表的可能性
String possibility = (String) this.getServletContext().getAttribute(transaction.getStage());

request.setAttribute("possibility", possibility);

<b>${possibility }</b>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值