com.actuate.activeportal.beans
Class UserAgentBean

java.lang.Object
  extended by com.actuate.activeportal.beans.UserAgentBean
All Implemented Interfaces:
java.io.Serializable

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

This bean detects what kind of browser the user use from http header "user-agent". After you instantiate this bean, you need to call setRequest(HttpServletRequest request). You can tell the browser type by calling isIE, isNS4 and isNS6 methods.

See Also:
Serialized Form

Constructor Summary
UserAgentBean()
           
 
Method Summary
 java.lang.String getUseragent()
          Returns the user agent string from http header.
 boolean isIE()
          Returns whether the client browser is Internet Explorer
 boolean isNetEnabled()
          Returns whether .NET extension is enabled in the client browser
 boolean isNS4()
          Returns whether the client browser is Netscape 4.x
 boolean isNS6()
          Returns whether the client browser is Netscape 6.x
 void setRequest(javax.servlet.http.HttpServletRequest request)
          This function reads http header "User-Agent" and process the information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserAgentBean

public UserAgentBean()
Method Detail

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest request)
This function reads http header "User-Agent" and process the information. You need to call this function after creating this bean.

Parameters:
request -

getUseragent

public java.lang.String getUseragent()
Returns the user agent string from http header.

Returns:
The user agent string

isNetEnabled

public boolean isNetEnabled()
Returns whether .NET extension is enabled in the client browser

Returns:
true if .Net is enabled

isIE

public boolean isIE()
Returns whether the client browser is Internet Explorer

Returns:
true if the client is Internet Explorer

isNS6

public boolean isNS6()
Returns whether the client browser is Netscape 6.x

Returns:
true if the client is Netscape 6.x

isNS4

public boolean isNS4()
Returns whether the client browser is Netscape 4.x

Returns:
true if the client is Netscape 4.x