<%

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

// This sample builds on basics.jsp and adds Page Load Time (PLT) detection.
// For more information on PLT see http://cyscape.com/plt

// The important parts of the file are the PLTOptions construction and
// the pltHead() call in the page's head block that uses the PLTOptions
// instance.  Also there are <span> elements in the page with special
// id values into which the timing results are dynamically placed after
// the page finishes loading, in case you want to show times somewhere
// in the page in addition to recording them in the BRWS system.

%>

<%
// First let's import the com.cyscape.browserhawk namespace
%>

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

<%
// To avoid an exception, we check that the system executing this
// example has an Enterprise Edition license as required for PLT.
// Note: This is NOT needed in your pages, only for this sample.
if (BrowserHawk.getVersion().indexOf("Ent") == -1) {
  out.println("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;
}

// represents the "basic" (as defined above) properties this browser supports.
// Note that we do this by using the static factory method
// BrowserHawk.getBrowserInfo().

BrowserInfo browser = BrowserHawk.getBrowserInfo(request);

// At this point our browser object contains all the basic browser capability
// information for the current visitor.  Let's display this information to the
// screen to show what we've detected for this particular browser.

// 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");

%>

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

This sample builds on the Basics example to additionally record
Page Load Times.  The times are shown in the page and recorded
to a BrowserHawk Reports Web Service server.

<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 spend
rendering the page.
<BR>

<P>
<HR>
<P>

Your browser is: <%= browser.getBrowser() %> <%= browser.getFullversion() %><P>


Your platform is: <%= browser.getPlatform() %><P>
Browser major version: <%= browser.getMajorver() %><P>
Browser minor version: <%= browser.getMinorver() %><P>
Container* browser: <%= browser.getContainerBrowser() %><P>
Container version: <%= browser.getContainerVersion() %><P>
Container full version: <%= browser.getContainerFullversion() %><P>
Supports AJAX? <%= browser.getXMLHttpRequest() %><P>
Supports ActiveX controls? <%= browser.getActiveXControls() %><P>
Browser data file version: <%= browser.getBDDVersion() %>, dated: <%= browser.getBDDDate() %><P>
BrowserHawk version in use: <%= BrowserHawk.getVersion() %><P>

<p>
*Note: The "Container" properties are used to detect cases where an IE
rendering engine is running inside of another browser.  For instance Netscape
8 and later and AOL Explorer can emulate IE.  In these cases the
ContainerBrowser, ContainerVersion, and ContainerFullversion will contain
details about the browser that the IE engine is running inside of.  For
instance with Netscape 8.0.0.3 running in IE emulation mode, BrowserHawk will
return "Netscape", "8.0", and "8.0.0.3" for these properties respectively. 
<p>
<HR>

<P>
<b><a href="plt-basics.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>
