【发布时间】:2016-07-01 20:25:34
【问题描述】:
Hello i want to add JSTL C:if tag in a form but did not able to understand how to implement it .
i have a file for attractions where i want to add the c:if tag in it the task i want to carry out is whenever i am navigating from other page to this present page if there are no datas available from database it should show " no datas available please add new data "
the code for for the form is as follows
这是我必须添加 c:if 标记的代码,因为它显示了从城市页面导航的数据库中的景点列表及其 ID,我希望输出就像我从城市导航一样到景点页面,如果其中没有景点,我应该收到“没有可用数据,请添加新数据”的消息
<div class="row">
<div id="attractionList" class="col-sm-12">
<h3 >
Attractions
</h3>
<c:forEach items="${attraction}" var="a">
<div id="attractionTable" class="col-sm-3">
<form action="/RouternData/roternInternal" method="post">
<input type="hidden" value="YES" name="DELETEATTRACTION">
<input type="hidden" value="${a.cityid }" name="cityid">
<div class="box7">
<div>
<img alt="image1" src="jspfiles/image/vadodara-palace1.jpg"
width="100%" height="100px">
</div>
<div>
<br> <a
href='/RouternData/roternInternal?RETRIVEATTRACTIONDATA=YES&attractionId=${a.attractionId}'
onclick ="showAttractions()" name="attractionname">${a.attraction }</a><br>
<b>Day ;</b> <i> ${a.days }</i><br>
<b>Type of attraction :</b> <i>${a.type}</i><br>
<button type="submit" style="color: #990000" class="btn btn-link" value="${a.attractionId}"
name="attractionId">Delete</button>
</div>
</div>
</form>
</div>
<%-- <h3>${a.attraction }</h3>--%>
</c:forEach>
</div>
</div>
【问题讨论】: