删除套路:
在删除按钮处添加
href="${pageContext.request.contextPath}/CategoryServlet?method=delete?category.cid=${category.cid } "
在控制器中写:
获取cid 调用删除方法 转发数据
public void delete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String cid=request.getParameter("cid");
cs.delete(cid);
request.getRequestDispatcher("CategoryServlet?method=selectAll").for ward(request, response);
}