public class ServletUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
endTransaction() |
static java.io.InputStream |
extractInputStream(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static java.io.InputStream |
extractPartInputStream(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static java.lang.String |
getDecodedUri(javax.servlet.http.HttpServletRequest request) |
static java.lang.String |
getSessionProperty(java.lang.String key,
java.lang.String defaultValue) |
static java.lang.String |
getUserAgent() |
static boolean |
isTraceRequest(javax.servlet.http.HttpServletRequest request) |
static boolean |
isXhrRequest(javax.servlet.http.HttpServletRequest request) |
static void |
logRequest(java.lang.String method,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static java.lang.String[] |
parseUriParams(java.lang.String uri,
javax.servlet.http.HttpServletResponse response,
java.util.regex.Pattern p,
int numParams) |
static void |
sendErrorResponse(javax.servlet.http.HttpServletResponse response,
java.lang.Exception exception,
java.lang.String uri) |
static void |
sendResponseError(javax.servlet.http.HttpServletResponse response,
int sc,
java.lang.String msg) |
static void |
setCommonResponseHttpHeaders(javax.servlet.http.HttpServletResponse response,
boolean xhrRequest) |
static void |
setResponseStatus(javax.servlet.http.HttpServletResponse response,
int sc) |
static void |
startRequestLifecycle()
Called from JettyHTTPD.
|
static void |
startTransaction(java.lang.String userAgent,
java.lang.String sessionKey) |
public static void startRequestLifecycle()
public static void startTransaction(java.lang.String userAgent, java.lang.String sessionKey)
public static void endTransaction()
public static java.lang.String getUserAgent()
public static java.lang.String getSessionProperty(java.lang.String key, java.lang.String defaultValue)
public static void setResponseStatus(javax.servlet.http.HttpServletResponse response, int sc)
public static void sendResponseError(javax.servlet.http.HttpServletResponse response, int sc, java.lang.String msg) throws java.io.IOException
java.io.IOException
public static java.io.InputStream extractInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
java.io.IOException
public static java.io.InputStream extractPartInputStream(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
java.io.IOException
public static void sendErrorResponse(javax.servlet.http.HttpServletResponse response, java.lang.Exception exception, java.lang.String uri)
public static java.lang.String getDecodedUri(javax.servlet.http.HttpServletRequest request)
public static java.lang.String[] parseUriParams(java.lang.String uri, javax.servlet.http.HttpServletResponse response, java.util.regex.Pattern p, int numParams) throws java.io.IOException
java.io.IOException
public static boolean isXhrRequest(javax.servlet.http.HttpServletRequest request)
public static boolean isTraceRequest(javax.servlet.http.HttpServletRequest request)
public static void setCommonResponseHttpHeaders(javax.servlet.http.HttpServletResponse response, boolean xhrRequest)
public static void logRequest(java.lang.String method, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)