PROT-7 add servletjobbyday
authorNatasha Sherstneva <n.shertneva@gmail.com>
Mon, 25 Nov 2013 11:20:19 +0000 (11:20 +0000)
committerNatasha Sherstneva <n.shertneva@gmail.com>
Mon, 25 Nov 2013 11:20:19 +0000 (11:20 +0000)
server/compbio/listeners/ServletJobsByDay.java [new file with mode: 0644]

diff --git a/server/compbio/listeners/ServletJobsByDay.java b/server/compbio/listeners/ServletJobsByDay.java
new file mode 100644 (file)
index 0000000..6a861a9
--- /dev/null
@@ -0,0 +1,38 @@
+package compbio.listeners;
+
+import java.io.IOException;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import compbio.statistic.CassandraRequester;
+
+/**
+ * Servlet implementation class ServletByJobSequence
+ */
+public class ServletJobsByDay extends HttpServlet {
+       private static final long serialVersionUID = 1L;
+
+       /**
+        * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
+        */
+       protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+               String date = request.getParameter("date");
+               CassandraRequester cr = new CassandraRequester();
+               request.setAttribute("result", cr.readJobByDay(date));
+               request.setAttribute("date", date);
+               RequestDispatcher rd = request.getRequestDispatcher("/ReportJobsByADay.jsp");
+               rd.forward(request, response);
+       }
+
+       /**
+        * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
+        */
+       protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+               doGet(request, response);
+       }
+
+}