PROT-4 Initial code for remover servlet
[proteocache.git] / server / compbio / listeners / ServletDeleteRecord.java
1 package compbio.listeners;
2
3 import java.io.IOException;
4
5 import javax.servlet.RequestDispatcher;
6 import javax.servlet.ServletException;
7 import javax.servlet.http.HttpServlet;
8 import javax.servlet.http.HttpServletRequest;
9 import javax.servlet.http.HttpServletResponse;
10
11 import compbio.statistic.CassandraRequester;
12
13 /**
14  * Servlet implementation class ServletDeleteRecord
15  */
16 public class ServletDeleteRecord extends HttpServlet {
17         private static final long serialVersionUID = 1L;
18        
19         /**request
20          * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
21          */
22         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
23                 CassandraRequester cr = new CassandraRequester();
24                 String flagId = request.getParameter("byId");
25                 String jobId = request.getParameter("id");
26                 String date1 = request.getParameter("date1");
27                 String date2 = request.getParameter("date2");
28                 if (flagId.equals("on"))
29                         request.setAttribute("result", cr.countJobs(date1, date2));
30                 System.out.println(flagId);
31 //              request.setAttribute("IdJob", id);
32 //              RequestDispatcher rd = request.getRequestDispatcher("/ReportLogInfo.jsp");
33 //              rd.forward(request, response);
34         }
35
36         /**
37          * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
38          */
39         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
40                 doGet(request, response);
41         }
42
43 }