com.cc.framework.http
Class BrowserInfo

java.lang.Object
  extended bycom.cc.framework.http.BrowserInfo
All Implemented Interfaces:
java.io.Serializable

public class BrowserInfo
extends java.lang.Object
implements java.io.Serializable

This class stores information about the actual browser capabilities.

Version:
$Revision$
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private static BrowserInfo defaultSettings
          This is the default client Settings class that is used in the following cases There is no valid user session object available No client Settings object was registered in the user session
static java.lang.String KEY_JSCRIPT
          Java Script (boolean)
static java.lang.String KEY_JSVERSION
          Java Script Version (double)
private  java.util.Map properties
          Browser Properties
private static long serialVersionUID
          Serial Version UID
 
Constructor Summary
BrowserInfo()
          Constructor
 
Method Summary
static BrowserInfo get(javax.servlet.http.HttpSession session)
          Retrieves the current client settings from the user session.
static BrowserInfo get(javax.servlet.jsp.PageContext pageContext)
          Retrieves the current client settings from the user session.
 double getJavaScriptVersion()
          retrieve the supported Javascript Version
 java.lang.String getProperty(java.lang.String key)
          Retrieves a named property
 boolean isJavaScriptEnabled()
          Check if JavaScript is enabled for the users session
static BrowserInfo parse(java.lang.String encoded)
          Parses browser information from an encoded string
static void set(javax.servlet.http.HttpSession session, BrowserInfo info)
          Stores the Setting object in the users session
static void set(javax.servlet.jsp.PageContext pageContext, BrowserInfo info)
          Stores the Setting object in the users session
static boolean setFromRequest(javax.servlet.http.HttpServletRequest request)
          Sets the browser information from a hidden field.
static boolean setFromRequest(javax.servlet.http.HttpServletRequest request, java.lang.String name)
          Sets the browser information from a hidden field.
 void setProperty(java.lang.String key, java.lang.String value)
          sets the value for a named property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

KEY_JSCRIPT

public static final java.lang.String KEY_JSCRIPT
Java Script (boolean)

See Also:
Constant Field Values

KEY_JSVERSION

public static final java.lang.String KEY_JSVERSION
Java Script Version (double)

See Also:
Constant Field Values

defaultSettings

private static BrowserInfo defaultSettings
This is the default client Settings class that is used in the following cases


properties

private java.util.Map properties
Browser Properties

Constructor Detail

BrowserInfo

public BrowserInfo()
Constructor

Method Detail

parse

public static BrowserInfo parse(java.lang.String encoded)
Parses browser information from an encoded string

Parameters:
encoded - A String encoded list with the Browser information
Returns:
Returns a BrowserInfo Object filled with the values from the request

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
sets the value for a named property

Parameters:
key - The Property Name. This can be one of the KEY_xxx Constants
value - The property value or null

getProperty

public java.lang.String getProperty(java.lang.String key)
Retrieves a named property

Parameters:
key - The Property Name. This can be one of the KEY_xxx Constants
Returns:
The property value or null

get

public static BrowserInfo get(javax.servlet.jsp.PageContext pageContext)
Retrieves the current client settings from the user session. If no client information is available a default object will be returned.

Parameters:
pageContext - JSP Page Context
Returns:
actual Settings object or a default Settings Object

get

public static BrowserInfo get(javax.servlet.http.HttpSession session)
Retrieves the current client settings from the user session. If no client information is available a default object will be returned.

Parameters:
session - A valid user session
Returns:
actual Settings object or a default Settings Object

set

public static void set(javax.servlet.jsp.PageContext pageContext,
                       BrowserInfo info)
Stores the Setting object in the users session

Parameters:
pageContext - JSP Page Context
info - BroserInfo object

set

public static void set(javax.servlet.http.HttpSession session,
                       BrowserInfo info)
Stores the Setting object in the users session

Parameters:
session - A valid user session
info - BroserInfo object

setFromRequest

public static boolean setFromRequest(javax.servlet.http.HttpServletRequest request)
Sets the browser information from a hidden field.

This method needs a valid user session to store the BrowserInfo object.

Parameters:
request - HttpServletRequest
Returns:
returns true if a browser information object was created

setFromRequest

public static boolean setFromRequest(javax.servlet.http.HttpServletRequest request,
                                     java.lang.String name)
Sets the browser information from a hidden field.

This method needs a valid user session to store the BrowserInfo object.

Parameters:
request - HttpServletRequest
name - the name of the hidden field that stores the browser information.
Returns:
returns true if a browser information object was created

isJavaScriptEnabled

public boolean isJavaScriptEnabled()
Check if JavaScript is enabled for the users session

Returns:
true if Javascript is enabled

getJavaScriptVersion

public double getJavaScriptVersion()
retrieve the supported Javascript Version

Returns:
JavaScript version


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.