| 1 | package control.maglietta; | |
| 2 | ||
| 3 | import model.CarrelloModel; | |
| 4 | ||
| 5 | import javax.servlet.annotation.WebServlet; | |
| 6 | import javax.servlet.http.HttpServlet; | |
| 7 | import javax.servlet.http.HttpServletRequest; | |
| 8 | import javax.servlet.http.HttpServletResponse; | |
| 9 | import javax.servlet.http.HttpSession; | |
| 10 | import java.io.IOException; | |
| 11 | ||
| 12 | @WebServlet("/RimuoviMaglietta") | |
| 13 | public class RimuoviMaglietta extends HttpServlet { | |
| 14 | @Override | |
| 15 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) | |
| 16 | throws IOException { | |
| 17 | ||
| 18 | HttpSession session = req.getSession(); | |
| 19 | CarrelloModel carrello; | |
| 20 | ||
| 21 | synchronized (session) { | |
| 22 | carrello = (CarrelloModel) session.getAttribute("carrello"); | |
| 23 | } | |
| 24 | ||
| 25 | int id; | |
| 26 | try { | |
| 27 | id = Integer.parseInt(req.getParameter("ID")); | |
| 28 | } catch (NumberFormatException e) { | |
| 29 |
1
1. doPost : removed call to javax/servlet/http/HttpServletResponse::sendRedirect → KILLED |
resp.sendRedirect("pages/errorpage.jsp"); |
| 30 | return; | |
| 31 | } | |
| 32 | ||
| 33 | String taglia = req.getParameter("taglia"); | |
| 34 | ||
| 35 |
1
1. doPost : removed call to model/CarrelloModel::rimuovi → KILLED |
carrello.rimuovi(id, taglia); |
| 36 | } | |
| 37 | } | |
Mutations | ||
| 29 |
1.1 |
|
| 35 |
1.1 |