com.gisgraphy.webapp.util

## Class RequestUtil

- java.lang.Object
- - com.gisgraphy.webapp.util.RequestUtil

-     public final class RequestUtil
      extends Object

  Convenience class for setting and retrieving cookies.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `deleteCookie(javax.servlet.http.HttpServletResponse response, javax.servlet.http.Cookie cookie, String path)` Convenience method for deleting a cookie by name
    `static String` | `getAppURL(javax.servlet.http.HttpServletRequest request)` Convenience method to get the application's URL based on request variables.
    `static javax.servlet.http.Cookie` | `getCookie(javax.servlet.http.HttpServletRequest request, String name)` Convenience method to get a cookie by name
    `static void` | `setCookie(javax.servlet.http.HttpServletResponse response, String name, String value, String path)` Convenience method to set a cookie

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### setCookie

          public static void setCookie(javax.servlet.http.HttpServletResponse response,
                       String name,
                       String value,
                       String path)

      Convenience method to set a cookie
      Parameters:
        `response` - the current response
        `name` - the name of the cookie
        `value` - the value of the cookie
        `path` - the path to set it on

    - #### getCookie

          public static javax.servlet.http.Cookie getCookie(javax.servlet.http.HttpServletRequest request,
                                            String name)

      Convenience method to get a cookie by name
      Parameters:
        `request` - the current request
        `name` - the name of the cookie to find
      Returns:
        the cookie (if found), null if not found

    - #### deleteCookie

          public static void deleteCookie(javax.servlet.http.HttpServletResponse response,
                          javax.servlet.http.Cookie cookie,
                          String path)

      Convenience method for deleting a cookie by name
      Parameters:
        `response` - the current web response
        `cookie` - the cookie to delete
        `path` - the path on which the cookie was set (i.e. /appfuse)

    - #### getAppURL

          public static String getAppURL(javax.servlet.http.HttpServletRequest request)

      Convenience method to get the application's URL based on request variables.
      Parameters:
        `request` - the current request
      Returns:
        URL to application

Copyright © 2015. All rights reserved.