<%@ page import = "com.cyscape.browserhawk.*" %><%

  // This sample is provided under the terms of the BrowserHawk End User
  // License Agreement. Copyright (c) 2003-2011 cyScape, Inc. All rights
  // reserved.

  // This sample builds on broadband.jsp and adds Pate Load Time (PLT)
  // detection.  For more information on PLT see http://cyscape.com/plt.
  // You should read the broadband.jsp source before reviewing this source.

  // To avoid an exception, we check that the system executing this
  // example has a Professional or Enterprise Edition license as required
  // for this test.
  // Note: This is NOT needed in your pages, only for this sample.
  if (BrowserHawk.getVersion().indexOf("Ent") == -1) {
    out.println("Professional or Enterprise License Required.  ");
    out.println("You are using " + BrowserHawk.getVersion() + ".  ");
    out.println("See <a href='http://www.cyscape.com/order/'>http://www.cyscape.com/order/</a> for upgrade information.");
    return;
  }

  // Let's control how we want PLT to behave
  PLTOptions pltOptions = new PLTOptions();
  // There are many settings to control, here's a note on the session cookie
  pltOptions.setSessionIDCookieName("JSESSIONID");
  // You need to change this to point at your own BRWS service
  pltOptions.setBrwsURL("/reports/brws");

  ExtendedOptions options = new ExtendedOptions();
  options.addProperties("Broadband");
  options.setPageMessage("BrowserHawk is checking your connection. Please wait...");
  options.setBodyTag("BGCOLOR=#FFFFFF");
  options.setPageTitle("Please wait...");

  ExtendedBrowserInfo ebi =
    BrowserHawk.getExtendedBrowserInfo(request, response, options, pltOptions);

  // If ebi is null (undefined), we must end the current request here.  The
  // browser will now process the client side tests and call this page back a
  // second time, and this time ebi will not be null.
  if (ebi == null) return;
%>

<html>
  <head>
    <title>BrowserHawk Sample - Broadband Detection</title>
    <%=
      // This call must go in the head block for PLT to function
      BrowserHawk.pltHead(request, pltOptions)
    %>
  </head>
<body><font face="arial">
<blockquote>
<h2>BrowserHawk Broadband Detection Demo</h2>
<font size=3>

  <p>
  PLT says your request type was <b><span id="plt_hittype">unsupported</span></b>.
  It took <b><span id="plt_total">unsupported</span></b> seconds total to load this
  page of which <b><span id="plt_intra">unsupported</span></b> seconds was spent
  rendering the page.
  </p>

<b>Test results:  Broadband connection? <%= ebi.getBroadband() %></b>

<P>
<P>
<b><a href="plt-broadband.jsp">Retry this test</a></b><P>
<b><a href="index.html">Return to list of other JSP samples</a></b><P>
<b><a href="http://www.cyscape.com/order/">BrowserHawk Pricing and Ordering</a></b><P>
<b><a href="http://www.cyscape.com/">cyScape home page</a></b><P>
</font></blockquote>
</body>
</html>
