今天我遇到了一个具有挑战性的问题。它正在删除一条记录,因为我有一个链接。我的删除代码工作正常。使我的网页有吸引力我想要确认删除所以我想使用bootstrap模型。因此,当我点击删除链接时会弹出模型进行确认,如果我单击是,则记录应该删除。我的代码如下,
<tr>
<td>${teacher.getTeacherName()}</td>
<td>${teacher.getFormatedDoj()}</td>
<td>${teacher.getContactNo()}</td>
<td>${teacher.getEmail()}</td>
<td><a href="<%=request.getContextPath()%>/pages/teacher_details/view_teacher_info.jsp?teacherId=${teacher.getTeacherId()}">View</a>
</td>
<td><a href="<%=request.getContextPath()%>/pages/teacher_details/teacher_info.jsp?teacherId=${teacher.getTeacherId()}">Edit</a>
</td>
<td><a href="<%=request.getContextPath()%>/controller/TeacherManagementController?flowName=DELETE_TEACHER_INFO&teacherId=${teacher.getTeacherId()}">Delete</a>
</td>
</tr>
我在这里遇到的另一个挑战是,当我向控制器调用时,我正在传递teacherId以删除一个特殊记录,所以在这里我已经将teacherId传递给bootstrap模型jsp页面。那么如何在删除链接上调用bootstrap模型jsp页面以及如何在模型jsp页面中获取teacherId来调用控制器进行删除。请帮帮我。