package com.qadeer.web.servlet;

import com.qadeer.web.dao.StudentDao;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/DeleteServlet")
public class DeleteServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String stringId=request.getParameter("id");
        int id=Integer.parseInt(stringId);
        StudentDao.delete(id);
        response.sendRedirect("view.jsp");
    }
}