Package ubic.gemma.web.util
Class RequestUtil
- java.lang.Object
- 
- ubic.gemma.web.util.RequestUtil
 
- 
 public class RequestUtil extends Object RequestUtil utility classGood ol' copy-n-paste from http://www.javaworld.com/javaworld/jw-02-2002/ssl/utilityclass.txt which is referenced in the following article: http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-ssl.html From Appfuse.- Author:
- pavlidis
 
- 
- 
Constructor SummaryConstructors Constructor Description RequestUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static StringBuffercreateQueryStringFromMap(Map<String,String[]> m, String ampersand)Builds a query string from a given map of parametersstatic voiddeleteCookie(javax.servlet.http.HttpServletResponse response, javax.servlet.http.Cookie cookie, String path)Convenience method for deleting a cookie by namestatic StringgetAppURL(javax.servlet.http.HttpServletRequest request)Convenience method to get the application's URL based on request variables.static javax.servlet.http.CookiegetCookie(javax.servlet.http.HttpServletRequest request, String name)Convenience method to get a cookie by namestatic StringgetRequestParameters(javax.servlet.http.HttpServletRequest aRequest)static voidreclaimRequestAttributes(javax.servlet.http.HttpServletRequest aRequest)Returns request attributes from session to requeststatic voidsetCookie(javax.servlet.http.HttpServletResponse response, String name, String value, String path)static voidstowRequestAttributes(javax.servlet.http.HttpServletRequest aRequest)Stores request attributes in session
 
- 
- 
- 
Method Detail- 
createQueryStringFromMappublic 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 "&" )
- Returns:
- query string (with no leading "?")
 
 - 
deleteCookiepublic 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)
 
 - 
getAppURLpublic 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
 
 - 
getCookiepublic 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
 
 - 
getRequestParameterspublic static String getRequestParameters(javax.servlet.http.HttpServletRequest aRequest) - Parameters:
- aRequest- request
- Returns:
- Creates query String from request body parameters
 
 - 
reclaimRequestAttributespublic static void reclaimRequestAttributes(javax.servlet.http.HttpServletRequest aRequest) Returns request attributes from session to request- Parameters:
- aRequest- DOCUMENT ME!
 
 - 
setCookiepublic static void setCookie(javax.servlet.http.HttpServletResponse response, String name, String value, String path)
 - 
stowRequestAttributespublic static void stowRequestAttributes(javax.servlet.http.HttpServletRequest aRequest) Stores request attributes in session- Parameters:
- aRequest- the current request
 
 
- 
 
-