this is not the best way but you can pass url to your confirmation function and if user confirmed, redirect him.
function confirmation(url) {
if (confirm("Are you sure you want to delete the reservation?"))
location.replace(url);
}
<td>
<a href="updateStaffServlet?action=update&sID=<c:out" value=" ${staff.staffID} " class="btn btn-icons btn-rounded btn-light">
<i class="fa fa-pencil"></i>
update link
</a>
<a onclick="confirmation('deleteStaffServlet?action=delete&sID=<c:out')" value=" ${staff.staffID} " id="dltbtn" class="btn btn-icons btn-rounded btn-light">
<i class="fa fa-user-times"></i>
delete link
</a>
</td>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…