org.directwebremoting.util
Class BrowserDetect

java.lang.Object
  extended by org.directwebremoting.util.BrowserDetect

public class BrowserDetect
extends java.lang.Object

Various functions to do with working out what is at the other end of the wire, and what it can do.

Version number documentation

Firefox

Quick summary:

Safari

Quick summary:

For full information see the Safari and WebKit Version Information: at Apple Developer Connection and for browsers in general, see this fairly complete list of user agent strings.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
BrowserDetect()
           
 
Method Summary
static boolean atLeast(javax.servlet.http.HttpServletRequest request, UserAgent requiredUserAgent)
          Check that the user-agent string indicates some minimum browser level
static boolean atLeast(javax.servlet.http.HttpServletRequest request, UserAgent requiredUserAgent, int requiredVersion)
          Check that the user-agent string indicates some minimum browser level
static void debugBrowserVersions(javax.servlet.http.HttpServletRequest request)
          Deprecated. This method is for debugging only
static int getConnectionLimit(javax.servlet.http.HttpServletRequest request)
          How many connections can this browser open simultaneously?
static java.lang.String getUserAgentDebugString(javax.servlet.http.HttpServletRequest request)
          This method is for debugging only
static boolean supportsComet(javax.servlet.http.HttpServletRequest request)
          Does this web browser support comet?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserDetect

public BrowserDetect()
Method Detail

getConnectionLimit

public static int getConnectionLimit(javax.servlet.http.HttpServletRequest request)
How many connections can this browser open simultaneously?

Parameters:
request - The request so we can get at the user-agent header
Returns:
The number of connections that we think this browser can take

supportsComet

public static boolean supportsComet(javax.servlet.http.HttpServletRequest request)
Does this web browser support comet?

Parameters:
request - The request so we can get at the user-agent header
Returns:
True if long lived HTTP connections are supported

atLeast

public static boolean atLeast(javax.servlet.http.HttpServletRequest request,
                              UserAgent requiredUserAgent)
Check that the user-agent string indicates some minimum browser level

Parameters:
request - The browsers request
requiredUserAgent - The UA required
Returns:
true iff the browser matches the spec.

atLeast

public static boolean atLeast(javax.servlet.http.HttpServletRequest request,
                              UserAgent requiredUserAgent,
                              int requiredVersion)
Check that the user-agent string indicates some minimum browser level

Parameters:
request - The browsers request
requiredUserAgent - The UA required. Currently this is major version only
requiredVersion - The version required, or -1 if versions are not important
Returns:
true iff the browser matches the spec.

getUserAgentDebugString

public static java.lang.String getUserAgentDebugString(javax.servlet.http.HttpServletRequest request)
This method is for debugging only


debugBrowserVersions

@Deprecated
public static void debugBrowserVersions(javax.servlet.http.HttpServletRequest request)
Deprecated. This method is for debugging only


Copyright 2008