| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wiki.util.HttpUtil
public final class HttpUtil

Contains useful utilities for some common HTTP tasks.
| Method Summary | |
|---|---|
| static boolean | checkFor304(javax.servlet.http.HttpServletRequest req,
                       String pageName,
                       Date lastModified)If returns true, then should return a 304 (HTTP_NOT_MODIFIED) | 
| static String | createETag(String pageName,
                     Date lastModified)Creates an ETag based on page information. | 
| static String | getRemoteAddress(javax.servlet.http.HttpServletRequest req)returns the remote address by looking into x-forwarded-forheader or, if unavailable, 
 intoServletRequest.getRemoteAddr(). | 
| static String | guessValidURI(String uri)Attempts to form a valid URI based on the string given. | 
| static String | retrieveCookieValue(javax.servlet.http.HttpServletRequest request,
                                       String cookieName)Attempts to retrieve the given cookie value from the request. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static String getRemoteAddress(javax.servlet.http.HttpServletRequest req)
x-forwarded-for header or, if unavailable, 
 into ServletRequest.getRemoteAddr().
req - http request
public static String retrieveCookieValue(javax.servlet.http.HttpServletRequest request,
                                         String cookieName)
request - The current requestcookieName - The name of the cookie to fetch.
public static String createETag(String pageName,
                                Date lastModified)
pageName - The page name for which the ETag should be created.lastModified - The page last modified date for which the ETag should be created.
public static boolean checkFor304(javax.servlet.http.HttpServletRequest req,
                                  String pageName,
                                  Date lastModified)
req - the HTTP requestpageName - the wiki page name to check forlastModified - the last modified date of the wiki page to check for
public static String guessValidURI(String uri)
uri - URI to take a poke at
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||