com.davesag.jsf
Class UserAgent

java.lang.Object
  extended bycom.davesag.jsf.AbstractContextAwareBean
      extended bycom.davesag.jsf.UserAgent

public class UserAgent
extends AbstractContextAwareBean

The UserAgent managed bean provides information on the user's browser.

Version:
CVS Revision $Id:$

Field Summary
static String IE
          ie means Internet Exploiter.
static String LINUX
          linux implies any linux version.
static String MAC
          mac implies Mac OS X.
static String MOZILLA
          mozilla implies all manney of netscapes and other browsers that use the gecko rendering engine.
static String SAFARI
          safari implies all browsers using the KHTML rendering engine.
static String UNSUPPORTED
          unsupported implies we don't support that browser or os.
static String WINDOWS
          windows implies any windows version.
 
Constructor Summary
UserAgent()
          default constructor
 
Method Summary
 String getShortName()
          Get the lowercase short hand name for this browser.
 String getShortOSName()
          Get the lowercase short hand name for this operating system.
 boolean isIe()
          is the browser IE?
 boolean isLinux()
          is the user running linux?
 boolean isMac()
          is the user running mac os?
 boolean isMozilla()
          is the browser Mozilla or Netscape?
 boolean isSafari()
          is the browser Safari?
 boolean isWindows()
          is the user running windows?
 
Methods inherited from class com.davesag.jsf.AbstractContextAwareBean
addMessage, getContext, getMessageBundleName, getRequestParameter, getServletContext, getSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOZILLA

public static final String MOZILLA
mozilla implies all manney of netscapes and other browsers that use the gecko rendering engine.

See Also:
Constant Field Values

SAFARI

public static final String SAFARI
safari implies all browsers using the KHTML rendering engine.

See Also:
Constant Field Values

IE

public static final String IE
ie means Internet Exploiter.

See Also:
Constant Field Values

MAC

public static final String MAC
mac implies Mac OS X.

See Also:
Constant Field Values

WINDOWS

public static final String WINDOWS
windows implies any windows version.

See Also:
Constant Field Values

LINUX

public static final String LINUX
linux implies any linux version.

See Also:
Constant Field Values

UNSUPPORTED

public static final String UNSUPPORTED
unsupported implies we don't support that browser or os.

See Also:
Constant Field Values
Constructor Detail

UserAgent

public UserAgent()
default constructor

Method Detail

getShortName

public String getShortName()
Get the lowercase short hand name for this browser.

Returns:
one of "mozilla", "ie", "safari", or "unsupported"

getShortOSName

public String getShortOSName()
Get the lowercase short hand name for this operating system.

Returns:
one of "mozilla", "ie", "safari", or "unsupported"

isIe

public boolean isIe()
is the browser IE?

Returns:
true if the browser is IE.

isMozilla

public boolean isMozilla()
is the browser Mozilla or Netscape?

Returns:
true if the browser is Mozilla or Netscape.

isSafari

public boolean isSafari()
is the browser Safari?

Returns:
true if the browser is Safari.

isWindows

public boolean isWindows()
is the user running windows?

Returns:
true if the user is uring windows.

isMac

public boolean isMac()
is the user running mac os?

Returns:
true if the user is able to enjoy their computing experience.

isLinux

public boolean isLinux()
is the user running linux?

Returns:
true if the user is working too hard.


JSF Helper API version 20 Jan 2005. (C) 2004 Dave Sag.