| 1 | package control.ordine; | |
| 2 | ||
| 3 | import control.utente.Login; | |
| 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 | ||
| 12 | @WebServlet("/CheckoutRedirect") | |
| 13 | public class CheckoutRedirect extends HttpServlet { | |
| 14 | @Override | |
| 15 | protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { | |
| 16 | Integer tipoUtente = (Integer) req.getSession().getAttribute("tipoUtente"); | |
| 17 | ||
| 18 |
2
1. doPost : negated conditional → KILLED 2. doPost : negated conditional → KILLED |
if (tipoUtente == null || !tipoUtente.equals(Login.REGISTRATO)) { |
| 19 |
1
1. doPost : removed call to javax/servlet/http/HttpServletResponse::sendRedirect → KILLED |
resp.sendRedirect("pages/login.jsp"); |
| 20 | } | |
| 21 | else { | |
| 22 |
1
1. doPost : removed call to javax/servlet/http/HttpServletResponse::sendRedirect → KILLED |
resp.sendRedirect("pages/checkout.jsp"); |
| 23 | } | |
| 24 | } | |
| 25 | } | |
Mutations | ||
| 18 |
1.1 2.2 |
|
| 19 |
1.1 |
|
| 22 |
1.1 |