|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javawebparts.request.RequestHelpers
This class contains static methods that are too small to warrant their own class. General request-related utility methods.
Field Summary | |
private static org.apache.commons.logging.Log |
log
Log instance. |
Constructor Summary | |
private |
RequestHelpers()
This is a utility class, so we want a private noarg constructor so instances cannot be created. |
Method Summary | |
static java.lang.String |
generateGUID(javax.servlet.http.HttpServletRequest request)
Returns a 32 character string uniquely identifying the given request object. |
static java.util.Map |
getAllRequestInfo(javax.servlet.http.HttpServletRequest request)
This method is a convenience method that calls the other three and returns a Map containing all request attributes, parameters and headers. |
static java.lang.String |
getBodyContent(javax.servlet.http.HttpServletRequest request)
This method will return the body content of an HTTP request as a String. |
static javax.servlet.http.Cookie |
getCookie(javax.servlet.http.HttpServletRequest request,
java.lang.String cookieName)
This method will return the Cookie with the provided name, if it is present in the request. |
static java.util.Map |
getCookies(javax.servlet.http.HttpServletRequest request)
This method will return a Map of all cookies in the request. |
static java.lang.String |
getCookieValue(javax.servlet.http.HttpServletRequest request,
java.lang.String cookieName)
This method will return the value of the Cookie with the provided name, if it is present in the request. |
static java.util.Map |
getRequestAttributes(javax.servlet.http.HttpServletRequest request)
This method will return a Map that can be displayed which contains all request attributes. |
static java.util.Map |
getRequestHeaders(javax.servlet.http.HttpServletRequest request)
This method will return a Map that can be displayed which contains all request headers. |
static java.util.Map |
getRequestParameters(javax.servlet.http.HttpServletRequest request)
This method will return a Map that can be displayed which contains all request parameters. |
static void |
logAllRequestInfo(javax.servlet.http.HttpServletRequest request)
This method is a convenience method that calls the other three and dumps all headers, attributes and request to the log. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static org.apache.commons.logging.Log log
Constructor Detail |
private RequestHelpers()
Method Detail |
public static void logAllRequestInfo(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.public static java.util.Map getAllRequestInfo(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.
public static java.util.Map getRequestAttributes(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.
public static java.util.Map getRequestParameters(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.
public static java.util.Map getRequestHeaders(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.
public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
request
- A valid HTTPServletRequest object.cookieName
- The name of the Cookie
public static java.lang.String getCookieValue(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
request
- A valid HTTPServletRequest object.cookieName
- The name of the Cookie
public static java.util.Map getCookies(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.
public static java.lang.String generateGUID(javax.servlet.http.HttpServletRequest request)
request
- A valid HTTPServletRequest object.
public static java.lang.String getBodyContent(javax.servlet.http.HttpServletRequest request) throws java.io.IOException
request
- A valid HTTPServletRequest object.
java.io.IOException
- Catch-all exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |