com.dynamide.util
Class ServletTools

java.lang.Object
  extended by com.dynamide.DynamideObject
      extended by com.dynamide.util.ServletTools
All Implemented Interfaces:
IGet

public class ServletTools
extends DynamideObject


Nested Class Summary
static class ServletTools.UserIDPassword
           
 
Field Summary
static int BROWSER_DYNAMIDE_TEXT
           
static int BROWSER_IE
           
static int BROWSER_IE4
           
static int BROWSER_NETSCAPE_4
           
static int BROWSER_NETSCAPE_5
           
static int BROWSER_NETSCAPE_6
           
static int BROWSER_NETSCAPE_COMPATIBLE
           
static int BROWSER_NOT_SET
           
static java.lang.String BROWSER_STRING_DYNAMIDE_TEXT
           
static java.lang.String BROWSER_STRING_IE
           
static java.lang.String BROWSER_STRING_NETSCAPE_COMPATIBLE
           
static java.lang.String BROWSER_STRING_UNKNOWN
           
static int BROWSER_UNKNOWN
           
 
Fields inherited from class com.dynamide.DynamideObject
m_id
 
Constructor Summary
ServletTools()
           
ServletTools(DynamideObject owner)
           
 
Method Summary
static java.lang.String browserVersion(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String decodeURLString(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)
           
static java.lang.String decodeURLString(java.lang.String URLString)
           
static java.lang.String dumpRequestHeaders(javax.servlet.http.HttpServletRequest request, boolean html)
           
static java.lang.String dumpRequestInfo(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String dumpRequestInfo(javax.servlet.http.HttpServletRequest request, boolean html, java.lang.String headerColor)
           
static java.lang.String dumpRequestParams(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String dumpRequestParams(javax.servlet.http.HttpServletRequest request, java.lang.String headerColor)
           
static java.lang.String encodeURLString(java.lang.String s)
           
static int findBrowserID(javax.servlet.http.HttpServletRequest request)
          Mozilla/4.79 [en] (Windows NT 5.0; U) Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6 Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)
static javax.servlet.http.Cookie findCookie(javax.servlet.http.HttpServletRequest request, java.lang.String name)
           
static java.lang.String getBrowserStringFromID(int id)
           
static java.lang.String getCookieValue(javax.servlet.http.HttpServletRequest request, java.lang.String name)
           
static java.lang.String getFullURL(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getParameterValue(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)
          Different from ServletRequest.getParameter in that this function will never return a null, always and empty string if param not found.
static java.lang.String getProto(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getProtoHostPort(javax.servlet.http.HttpServletRequest request)
           
static java.lang.String getProtoHostPort(java.net.URL url)
           
static ServletTools.UserIDPassword getRemoteUser(javax.servlet.http.HttpServletRequest request)
           
protected static ServletTools.UserIDPassword getRemoteUser(java.lang.String authString)
           
static java.lang.String getURL(javax.servlet.http.HttpServletRequest request)
           
static boolean isBrowserIE(int bid)
           
static boolean isBrowserNS4x(int bid)
           
static javax.servlet.http.Cookie setCookie(javax.servlet.http.HttpServletResponse response, java.lang.String name, java.lang.String value)
           
static javax.servlet.http.Cookie setCookie(javax.servlet.http.HttpServletResponse response, java.lang.String name, java.lang.String value, java.lang.String path, int maxAge)
           
 
Methods inherited from class com.dynamide.DynamideObject
clearProfiler, dump, dump, dumpHTML, expand, finalize, findParentExpander, findParentPage, findParentSession, findTopParentPage, get, getCategoryID, getDotName, getID, getNextGetter, getObjectID, getOwner, getProfiler, isDebugEnabled, isInfoEnabled, logDebug, logDebug, logDebug, logDebug, logError, logError, logError, logError, logInfo, logInfo, logInfo, logInfo, logWarn, logWarn, logWarn, logWarn, popLogContext, printf, printProfiler, profileEnter, profileLeave, pushLogContext, setDotName, setID, setNextGetter, setObjectID, setOwner, sprintf, useProfiler, walkParents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BROWSER_NOT_SET

public static final int BROWSER_NOT_SET
See Also:
Constant Field Values

BROWSER_UNKNOWN

public static final int BROWSER_UNKNOWN
See Also:
Constant Field Values

BROWSER_IE4

public static final int BROWSER_IE4
See Also:
Constant Field Values

BROWSER_NETSCAPE_COMPATIBLE

public static final int BROWSER_NETSCAPE_COMPATIBLE
See Also:
Constant Field Values

BROWSER_NETSCAPE_4

public static final int BROWSER_NETSCAPE_4
See Also:
Constant Field Values

BROWSER_NETSCAPE_5

public static final int BROWSER_NETSCAPE_5
See Also:
Constant Field Values

BROWSER_NETSCAPE_6

public static final int BROWSER_NETSCAPE_6
See Also:
Constant Field Values

BROWSER_IE

public static final int BROWSER_IE
See Also:
Constant Field Values

BROWSER_DYNAMIDE_TEXT

public static final int BROWSER_DYNAMIDE_TEXT
See Also:
Constant Field Values

BROWSER_STRING_UNKNOWN

public static final java.lang.String BROWSER_STRING_UNKNOWN
See Also:
Constant Field Values

BROWSER_STRING_IE

public static final java.lang.String BROWSER_STRING_IE
See Also:
Constant Field Values

BROWSER_STRING_NETSCAPE_COMPATIBLE

public static final java.lang.String BROWSER_STRING_NETSCAPE_COMPATIBLE
See Also:
Constant Field Values

BROWSER_STRING_DYNAMIDE_TEXT

public static final java.lang.String BROWSER_STRING_DYNAMIDE_TEXT
See Also:
Constant Field Values
Constructor Detail

ServletTools

public ServletTools()

ServletTools

public ServletTools(DynamideObject owner)
Method Detail

getBrowserStringFromID

public static final java.lang.String getBrowserStringFromID(int id)

getParameterValue

public static java.lang.String getParameterValue(javax.servlet.http.HttpServletRequest request,
                                                 java.lang.String paramName)
Different from ServletRequest.getParameter in that this function will never return a null, always and empty string if param not found.


getURL

public static java.lang.String getURL(javax.servlet.http.HttpServletRequest request)

getFullURL

public static java.lang.String getFullURL(javax.servlet.http.HttpServletRequest request)

getProto

public static java.lang.String getProto(javax.servlet.http.HttpServletRequest request)
Returns:
"http" or "https", without the "://" part.

getProtoHostPort

public static java.lang.String getProtoHostPort(javax.servlet.http.HttpServletRequest request)

getProtoHostPort

public static java.lang.String getProtoHostPort(java.net.URL url)

decodeURLString

public static java.lang.String decodeURLString(javax.servlet.http.HttpServletRequest request,
                                               java.lang.String paramName)

decodeURLString

public static java.lang.String decodeURLString(java.lang.String URLString)

encodeURLString

public static java.lang.String encodeURLString(java.lang.String s)

dumpRequestInfo

public static java.lang.String dumpRequestInfo(javax.servlet.http.HttpServletRequest request)

dumpRequestInfo

public static java.lang.String dumpRequestInfo(javax.servlet.http.HttpServletRequest request,
                                               boolean html,
                                               java.lang.String headerColor)

dumpRequestHeaders

public static java.lang.String dumpRequestHeaders(javax.servlet.http.HttpServletRequest request,
                                                  boolean html)

dumpRequestParams

public static java.lang.String dumpRequestParams(javax.servlet.http.HttpServletRequest request)

dumpRequestParams

public static java.lang.String dumpRequestParams(javax.servlet.http.HttpServletRequest request,
                                                 java.lang.String headerColor)

getRemoteUser

public static ServletTools.UserIDPassword getRemoteUser(javax.servlet.http.HttpServletRequest request)

getRemoteUser

protected static ServletTools.UserIDPassword getRemoteUser(java.lang.String authString)

browserVersion

public static java.lang.String browserVersion(javax.servlet.http.HttpServletRequest request)

findBrowserID

public static int findBrowserID(javax.servlet.http.HttpServletRequest request)
Mozilla/4.79 [en] (Windows NT 5.0; U) Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6 Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)


isBrowserIE

public static boolean isBrowserIE(int bid)

isBrowserNS4x

public static boolean isBrowserNS4x(int bid)

getCookieValue

public static java.lang.String getCookieValue(javax.servlet.http.HttpServletRequest request,
                                              java.lang.String name)

findCookie

public static javax.servlet.http.Cookie findCookie(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.String name)

setCookie

public static javax.servlet.http.Cookie setCookie(javax.servlet.http.HttpServletResponse response,
                                                  java.lang.String name,
                                                  java.lang.String value)

setCookie

public static javax.servlet.http.Cookie setCookie(javax.servlet.http.HttpServletResponse response,
                                                  java.lang.String name,
                                                  java.lang.String value,
                                                  java.lang.String path,
                                                  int maxAge)


Copyright 2001-2013 DYNAMIDE.COM. All Rights Reserved.