What I am working is to implement a table to show the upcoming appointments , where i have a if statement in which I am looking to implement to prevent showing data that's old and not in current time frame. For example yesterdays or weeks before appointments shouldn't be shown in the jsp ?
I taught of an if statement , well the code currently is :
<form method="POST" action="<%=request.getContextPath()%>/Appointment/delete">
<c:choose>
<c:when test="${empty list}">
<h1>No appointments available</h1>
</c:when>
<c:otherwise>
<table class="styled-table" style="margin-bottom: 15px; margin-top:15px;">
<thead>
<tr>
<th>Patient Name</th>
<th>Appointment Date</th>
<th>Delete</th>
</tr>
</thead>
<c:forEach items="${list}" var="record">
<c:choose>
<c:when test="${record.date lt} <% LocalDateTime now = LocalDateTime.now(); %>">
<tbody>
<tr class="active-row">
<td>${record.name}</td>
<td>${record.date}</td>
<td id="id"><button class="delete" value="${record.appointmentId}" ><i class="fas fa-trash-alt"></i></button></a></td>
</tr>
</tbody>
</c:when>
<c:otherwise>
</c:otherwise>
</c:choose>
</c:forEach>
</table >
</form>
Well i am quite new to learning jsp and java web development stuff would really appreciate help in getting this work . Thanks in advance.