| java.lang.Object com.ecyrd.jspwiki.util.HttpUtil
HttpUtil | final public class HttpUtil (Code) | | Contains useful utilities for some common HTTP tasks.
author: Janne Jalkanen since: 2.1.61. |
Field Summary | |
static Logger | log |
checkFor304 | public static boolean checkFor304(HttpServletRequest req, WikiPage page)(Code) | | If returns true, then should return a 304 (HTTP_NOT_MODIFIED)
Parameters: req - the HTTP request Parameters: page - the wiki page to check for the result of the check |
createETag | public static String createETag(WikiPage p)(Code) | | Creates an ETag based on page information. An ETag is unique to each page
and version, so it can be used to check if the page has changed. Do not
assume that the ETag is in any particular format.
Parameters: p - The page for which the ETag should be created. A String depiction of an ETag. |
guessValidURI | public static String guessValidURI(String uri)(Code) | | Attempts to form a valid URI based on the string given. Currently
it can guess email addresses (mailto:). If nothing else is given,
it assumes it to be a http:// url.
Parameters: uri - URI to take a poke at Possibly a valid URI since: 2.2.8 |
retrieveCookieValue | public static String retrieveCookieValue(HttpServletRequest request, String cookieName)(Code) | | Attempts to retrieve the given cookie value from the request.
Returns the string value (which may or may not be decoded
correctly, depending on browser!), or null if the cookie is
not found. The algorithm will automatically trim leading
and trailing double quotes, if found.
Parameters: request - The current request Parameters: cookieName - The name of the cookie to fetch. Value of the cookie, or null, if there is no such cookie. |
|
|