DeleteServlet.java 754 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
package com.roshka.proyectofinal.bootcamp;

import java.io.IOException;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

10
@WebServlet("/DeleteServletBootcamp")
11 12 13 14
public class DeleteServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String sid=request.getParameter("id");
15

16 17 18 19 20 21
        int id=Integer.parseInt(sid);
        System.out.println("Este es el id " + id);
        BootcampDao.delete(id);
        response.sendRedirect("formulario_bootcamp.jsp");
    }
}