Package de.businesscode.bcdui.toolbox
Class ServletUtils
java.lang.Object
de.businesscode.bcdui.toolbox.ServletUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddParameterToURL(String url, String param, String value) addParameterToURLlongcomputeExpirationDate(int liveTimeInMinutes) computeExpirationDatestatic ServletUtilsgetSessionId(jakarta.servlet.http.HttpServletRequest request) retrieve session id w/o forcing the session instance to be createdbooleanisAgentIE6(jakarta.servlet.http.HttpServletRequest req) booleanisAgentIE6(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)booleanisFeDebug(jakarta.servlet.http.HttpServletRequest request) tells if application is running with frontend debug enabled flag.reconstructURI(jakarta.servlet.http.HttpServletRequest request) Method reconstructURIreconstructURL(jakarta.servlet.http.HttpServletRequest request) reconstructURLvoidsetExpirationHeader(jakarta.servlet.http.HttpServletResponse response, int liveTimeInMinutes) setExpirationHeadervoidsetExpirationHeader(jakarta.servlet.http.HttpServletResponse response, long time) Deprecated.use instead public void setExpirationHeader(HttpServletResponse response, int liveTimeInMinutes)voidsetFeDebug(jakarta.servlet.http.HttpServletRequest request, boolean isFeDebug) sets FE debug mode into session object.
-
Constructor Details
-
ServletUtils
public ServletUtils()
-
-
Method Details
-
getInstance
-
isFeDebug
public boolean isFeDebug(jakarta.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(jakarta.servlet.http.HttpServletRequest request, boolean isFeDebug) sets FE debug mode into session object.- Parameters:
request-isFeDebug-
-
getSessionId
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
reconstructURL- Parameters:
request-- Returns:
-
reconstructURI
Method reconstructURI- Parameters:
request-- Returns:
-
computeExpirationDate
public long computeExpirationDate(int liveTimeInMinutes) computeExpirationDate- Parameters:
liveTimeInMinutes-- Returns:
-
setExpirationHeader
public void setExpirationHeader(jakarta.servlet.http.HttpServletResponse response, int liveTimeInMinutes) setExpirationHeader- Parameters:
response-liveTimeInMinutes-
-
setExpirationHeader
@Deprecated public void setExpirationHeader(jakarta.servlet.http.HttpServletResponse response, long time) Deprecated.use instead public void setExpirationHeader(HttpServletResponse response, int liveTimeInMinutes)- Parameters:
response-time-
-
addParameterToURL
addParameterToURL- Parameters:
url-param-value-- Returns:
-
isAgentIE6
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:
NullPointerException- if userAgentString is NULL
-
isAgentIE6
- Parameters:
req-- Returns:
- Throws:
NullPointerException
-