Class RequestUtil

    • Constructor Detail

      • RequestUtil

        public RequestUtil()
    • Method Detail

      • createQueryStringFromMap

        public static StringBuffer createQueryStringFromMap​(Map<String,​String[]> m,
                                                            String ampersand)
        Builds a query string from a given map of parameters
        Parameters:
        m - A map of parameters
        ampersand - String to use for ampersands (e.g. "&" or "&amp;" )
        Returns:
        query string (with no leading "?")
      • 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 remove
        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. NOTE: this is pretty useless if running behind a proxy.
        Parameters:
        request - request
        Returns:
        app url
      • 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
      • getRequestParameters

        public static String getRequestParameters​(javax.servlet.http.HttpServletRequest aRequest)
        Parameters:
        aRequest - request
        Returns:
        Creates query String from request body parameters
      • reclaimRequestAttributes

        public static void reclaimRequestAttributes​(javax.servlet.http.HttpServletRequest aRequest)
        Returns request attributes from session to request
        Parameters:
        aRequest - DOCUMENT ME!
      • setCookie

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

        public static void stowRequestAttributes​(javax.servlet.http.HttpServletRequest aRequest)
        Stores request attributes in session
        Parameters:
        aRequest - the current request