From fdb9a57d5a72732fbe7cd9c94d607d7c12080ca7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?F=C3=A1bio=20Madeira?= Date: Mon, 29 May 2017 17:42:37 +0100 Subject: [PATCH] JWS-121 Added new jsp enpoints that try loading chached service status and usage statistics pages. If not available there is a redirect to the main endpoints. Also fixed the header and footer links to match the new endpoints. --- website/service_status.jsp | 57 ++++++++++++++++++++++++++++++++++++++++++ website/template_footer.jsp | 6 ++--- website/template_header.jsp | 22 ++-------------- website/usage_statistics.jsp | 57 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 24 deletions(-) create mode 100644 website/service_status.jsp create mode 100644 website/usage_statistics.jsp diff --git a/website/service_status.jsp b/website/service_status.jsp new file mode 100644 index 0000000..892c78d --- /dev/null +++ b/website/service_status.jsp @@ -0,0 +1,57 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> + +<%@ 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" %> + + + Service Status + + + +<%-- check if the cached page is available: if not redirects--%> +<%@ page import="java.io.*,java.net.*" %> +<% + URL url = new URL(request.getRequestURL().toString().replaceAll("/service_status.jsp", "") + + "/cached_service_status.html"); + HttpURLConnection http = (HttpURLConnection)url.openConnection(); + int statusCode = http.getResponseCode(); + if (statusCode != 200) { + String redirectURL = "ServiceStatus"; + response.sendRedirect(redirectURL);} +%> + +<%-- load cached Service Status --%> +
+
+
+
+ + + +
+
+
+
+ +
+
+

The results shown below have been cached from a request made (up to an hour) before... + Get fresh Service Status +

+
+
+ + + + diff --git a/website/template_footer.jsp b/website/template_footer.jsp index d89ea8f..d5c2d57 100644 --- a/website/template_footer.jsp +++ b/website/template_footer.jsp @@ -37,13 +37,11 @@ Citing JABAWS
  • - Service Status + Service Status
  • - Usage Statistics + Usage Statistics
  • Funding diff --git a/website/template_header.jsp b/website/template_header.jsp index 4309962..fff4c81 100644 --- a/website/template_header.jsp +++ b/website/template_header.jsp @@ -150,13 +150,11 @@
  • - + Service Status
  • - + Usage Statistics
  • @@ -171,19 +169,3 @@
    -
    -
    -
    -
    - - - -
    -
    -
    -
    diff --git a/website/usage_statistics.jsp b/website/usage_statistics.jsp new file mode 100644 index 0000000..5f0f6b3 --- /dev/null +++ b/website/usage_statistics.jsp @@ -0,0 +1,57 @@ + +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> + +<%@ 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" %> + + + Usage Statistics + + + +<%-- check if the cached page is available: if not redirects--%> +<%@ page import="java.io.*,java.net.*" %> +<% + URL url = new URL(request.getRequestURL().toString().replaceAll("/usage_statistics.jsp", "") + + "/cached_usage_statistics.html"); + HttpURLConnection http = (HttpURLConnection)url.openConnection(); + int statusCode = http.getResponseCode(); + if (statusCode != 200) { + String redirectURL = "PublicAnnualStat"; + response.sendRedirect(redirectURL);} +%> + +<%-- load cached Service Status --%> +
    +
    +
    +
    + + + +
    +
    +
    +
    + +
    +
    +

    The results shown below have been cached from a request made (up to an hour) before... + Get fresh Usage Statistics +

    +
    +
    + + + + -- 1.7.10.2