Package de.businesscode.bcdui.toolbox
Class ServletUtils
- java.lang.Object
-
- de.businesscode.bcdui.toolbox.ServletUtils
-
public class ServletUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ServletUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
addParameterToURL(java.lang.String url, java.lang.String param, java.lang.String value)
addParameterToURLlong
computeExpirationDate(int liveTimeInMinutes)
computeExpirationDatestatic ServletUtils
getInstance()
java.lang.String
getSessionId(javax.servlet.http.HttpServletRequest request)
retrieve session id w/o forcing the session instance to be createdboolean
isAgentIE6(java.lang.String userAgentString)
since IE6 requires a lot of workarounds, this method can be called to determine if given User-Agent ID claims to be IE6. see also {isAgentIE6(String)
boolean
isAgentIE6(javax.servlet.http.HttpServletRequest req)
boolean
isFeDebug(javax.servlet.http.HttpServletRequest request)
tells if application is running with frontend debug enabled flag.java.lang.String
reconstructURI(javax.servlet.http.HttpServletRequest request)
Method reconstructURIjava.lang.String
reconstructURL(javax.servlet.http.HttpServletRequest request)
reconstructURLvoid
setExpirationHeader(javax.servlet.http.HttpServletResponse response, int liveTimeInMinutes)
setExpirationHeadervoid
setExpirationHeader(javax.servlet.http.HttpServletResponse response, long time)
Deprecated.use instead public void setExpirationHeader(HttpServletResponse response, int liveTimeInMinutes)void
setFeDebug(javax.servlet.http.HttpServletRequest request, boolean isFeDebug)
sets FE debug mode into session object.
-
-
-
Method Detail
-
getInstance
public static ServletUtils getInstance()
-
isFeDebug
public boolean isFeDebug(javax.servlet.http.HttpServletRequest request)
tells if application is running with frontend debug enabled flag. This method is stateful on session level and stores the debug status persistenly to sessesion variable whenever status changes. Private methods shall check the debug status without it being to be stored on session please use isFeDebugStateless(HttpServletRequest instead.- Parameters:
request
-- Returns:
-
setFeDebug
public void setFeDebug(javax.servlet.http.HttpServletRequest request, boolean isFeDebug)
sets FE debug mode into session object.- Parameters:
request
-isFeDebug
-
-
getSessionId
public java.lang.String getSessionId(javax.servlet.http.HttpServletRequest request)
retrieve session id w/o forcing the session instance to be created- Parameters:
request
- to read session from- Returns:
- either session id or NULL
-
reconstructURL
public java.lang.String reconstructURL(javax.servlet.http.HttpServletRequest request)
reconstructURL- Parameters:
request
-- Returns:
-
reconstructURI
public java.lang.String reconstructURI(javax.servlet.http.HttpServletRequest request)
Method reconstructURI- Parameters:
request
-- Returns:
-
computeExpirationDate
public long computeExpirationDate(int liveTimeInMinutes)
computeExpirationDate- Parameters:
liveTimeInMinutes
-- Returns:
-
setExpirationHeader
public void setExpirationHeader(javax.servlet.http.HttpServletResponse response, int liveTimeInMinutes)
setExpirationHeader- Parameters:
response
-liveTimeInMinutes
-
-
setExpirationHeader
@Deprecated public void setExpirationHeader(javax.servlet.http.HttpServletResponse response, long time)
Deprecated.use instead public void setExpirationHeader(HttpServletResponse response, int liveTimeInMinutes)- Parameters:
response
-time
-
-
addParameterToURL
public java.lang.String addParameterToURL(java.lang.String url, java.lang.String param, java.lang.String value)
addParameterToURL- Parameters:
url
-param
-value
-- Returns:
-
isAgentIE6
public boolean isAgentIE6(java.lang.String userAgentString) throws java.lang.NullPointerException
since IE6 requires a lot of workarounds, this method can be called to determine if given User-Agent ID claims to be IE6. see also {isAgentIE6(String)
- Parameters:
userAgentString
- the String given by User-Agent header field- Returns:
- true if agent appears to be IE6
- Throws:
java.lang.NullPointerException
- if userAgentString is NULL
-
isAgentIE6
public boolean isAgentIE6(javax.servlet.http.HttpServletRequest req) throws java.lang.NullPointerException
- Parameters:
req
-- Returns:
- Throws:
java.lang.NullPointerException
-
-