| 1 | package control; | |
| 2 | ||
| 3 | import model.maglietta.MagliettaDAO; | |
| 4 | ||
| 5 | import javax.servlet.ServletException; | |
| 6 | import javax.servlet.annotation.WebServlet; | |
| 7 | import javax.servlet.http.HttpServlet; | |
| 8 | import javax.servlet.http.HttpServletRequest; | |
| 9 | import javax.servlet.http.HttpServletResponse; | |
| 10 | import java.io.IOException; | |
| 11 | import java.sql.SQLException; | |
| 12 | ||
| 13 | @WebServlet("/Home") | |
| 14 | public class Home extends HttpServlet { | |
| 15 | @Override | |
| 16 | protected void doGet(HttpServletRequest req, HttpServletResponse resp) | |
| 17 | throws ServletException, IOException { | |
| 18 | ||
| 19 | MagliettaDAO magliettaDAO = new MagliettaDAO(); | |
| 20 | String targetJsp; | |
| 21 | ||
| 22 | try { | |
| 23 |
1
1. doGet : removed call to javax/servlet/http/HttpServletRequest::setAttribute → KILLED |
req.setAttribute( |
| 24 | "magliette", | |
| 25 | magliettaDAO.doRetriveAll(req.getParameter("ordine")) | |
| 26 | ); | |
| 27 | targetJsp = "/index.jsp"; | |
| 28 | ||
| 29 | } catch (SQLException e) { | |
| 30 | targetJsp = "/pages/errorpage.jsp"; | |
| 31 | } | |
| 32 | ||
| 33 | try { | |
| 34 |
1
1. doGet : removed call to javax/servlet/RequestDispatcher::forward → KILLED |
req.getRequestDispatcher(targetJsp).forward(req, resp); |
| 35 | } catch (ServletException | IOException e) { | |
| 36 |
1
1. doGet : removed call to javax/servlet/RequestDispatcher::forward → KILLED |
req.getRequestDispatcher("/pages/errorpage.jsp").forward(req, resp); |
| 37 | } | |
| 38 | } | |
| 39 | ||
| 40 | @Override | |
| 41 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) | |
| 42 | throws ServletException, IOException { | |
| 43 |
1
1. doPost : removed call to control/Home::doGet → KILLED |
doGet(req, resp); |
| 44 | } | |
| 45 | } | |
Mutations | ||
| 23 |
1.1 |
|
| 34 |
1.1 |
|
| 36 |
1.1 |
|
| 43 |
1.1 |