com.itmill.toolkit.terminal.web
Class WebBrowserProbe

java.lang.Object
  extended by com.itmill.toolkit.terminal.web.WebBrowserProbe

public class WebBrowserProbe
extends Object

The WebBrowserProbe uses JavaScript to determine the capabilities of the client browser.

Since:
3.0
Version:
4.1.4
Author:
IT Mill Ltd.

Constructor Summary
WebBrowserProbe()
           
 
Method Summary
static WebBrowser getTerminalType(HttpSession session)
          Returns the terminal type from the given session.
static boolean handleProbeRequest(HttpServletRequest request, Map parameters)
          Handles the client checking.
static WebBrowser probe(String agent)
          Determines versions based on user agent string.
static WebBrowser probe(WebBrowser browser, HttpServletRequest request, Map params)
          Creates new instance of WebBrowser by initializing the values based on user request.
static void setTerminalType(HttpSession session, WebBrowser terminal)
          Sets the terminal type for the given session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebBrowserProbe

public WebBrowserProbe()
Method Detail

getTerminalType

public static WebBrowser getTerminalType(HttpSession session)
Returns the terminal type from the given session.

Parameters:
session - the HTTP session.
Returns:
WebBrowser instance for the given session.

setTerminalType

public static void setTerminalType(HttpSession session,
                                   WebBrowser terminal)
Sets the terminal type for the given session.

Parameters:
session - the HTTP session.
terminal - the web browser.

handleProbeRequest

public static boolean handleProbeRequest(HttpServletRequest request,
                                         Map parameters)
                                  throws ServletException
Handles the client checking.

Parameters:
request - the HTTP request to process.
parameters - the Parameters to be used as defaults.
Returns:
true if response should include a probe script,otherwise false.
Throws:
ServletException - if an exception has occurred that interferes with the servlet's normal operation.

probe

public static WebBrowser probe(String agent)
Determines versions based on user agent string.

Parameters:
agent - the HTTP User-Agent request header.
Returns:
new WebBrowser instance initialized based on agent features.

probe

public static WebBrowser probe(WebBrowser browser,
                               HttpServletRequest request,
                               Map params)
Creates new instance of WebBrowser by initializing the values based on user request.

Parameters:
browser - the browser to be updated. If null a new instance is created.
request - the Request to be used as defaults.
params - the Parameters to be used as defaults.
Returns:
new WebBrowser instance initialized based on request parameters.


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.