From: Sasha Sherstnev Date: Thu, 31 Oct 2013 22:54:13 +0000 (+0000) Subject: Some new servlet code X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=087b1f737fa766ad9986a9dae55feac4e483beb7;p=proteocache.git Some new servlet code --- diff --git a/server/compbio/listeners/LogServlet.java b/server/compbio/listeners/LogServlet.java new file mode 100644 index 0000000..0f6d007 --- /dev/null +++ b/server/compbio/listeners/LogServlet.java @@ -0,0 +1,43 @@ +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.StatisticsProt; + +/** + * Servlet implementation class LogServlet + */ +public class LogServlet 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 { + final long startTime = System.currentTimeMillis(); + String id = request.getParameter("IdJob"); + StatisticsProt sp = new StatisticsProt(); +// request.setAttribute("result", sp.readJobLog(id)); + final long endTime = System.currentTimeMillis(); + request.setAttribute("timeExecution", (endTime - startTime)); + request.setAttribute("IdJob", id); + RequestDispatcher rd = request.getRequestDispatcher("/ReportLog.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); + } + +} diff --git a/website/LogQuery.jsp b/website/LogQuery.jsp new file mode 100644 index 0000000..a14fb87 --- /dev/null +++ b/website/LogQuery.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Log query + + +
+
+

Enter job ID

+
+

+
+ + \ No newline at end of file diff --git a/website/ReportLog.jsp b/website/ReportLog.jsp new file mode 100644 index 0000000..e3cc33e --- /dev/null +++ b/website/ReportLog.jsp @@ -0,0 +1,17 @@ +<%@page import="java.util.ArrayList"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> +<%@ taglib uri="http://displaytag.sf.net" prefix="dt" %> +

Jobs log information for: ${IdJob}

+

Time execution: ${timeExecution} ms

+ +

${res.nameColumn} : +${res.valueColumn} +

+
+ +

${res.namePrediction} : +${res.valuePrediction} +

+
\ No newline at end of file