From: Natasha Sherstneva Date: Mon, 25 Nov 2013 11:20:19 +0000 (+0000) Subject: PROT-7 add servletjobbyday X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3c879de133513ffb0156b4c4a2db40bcf301ef36;p=proteocache.git PROT-7 add servletjobbyday --- diff --git a/server/compbio/listeners/ServletJobsByDay.java b/server/compbio/listeners/ServletJobsByDay.java new file mode 100644 index 0000000..6a861a9 --- /dev/null +++ b/server/compbio/listeners/ServletJobsByDay.java @@ -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); + } + +}