org.springframework.extensions.surf.util
Class WebUtil

java.lang.Object
  extended by org.springframework.extensions.surf.util.WebUtil

public class WebUtil
extends Object

Static helper methods for working with query strings and maps.

Author:
muzquiano

Constructor Summary
WebUtil()
           
 
Method Summary
static String getQueryStringForMap(Map map)
          Returns the query string for a given map of key and value pairs
static Map getQueryStringMap(javax.servlet.http.HttpServletRequest request)
          Creates a Map of query string key and value parameters from the given request
static Map getQueryStringMap(String queryString)
          Creates a Map of query string key and value parameters from the given query string.
static Map getQueryStringMap(String queryString, String encoding)
          Creates a Map of query string key and value parameters from the given query string.
static String toFullyQualifiedURL(javax.servlet.http.HttpServletRequest request, String uri)
          Converts a relative URI to a fully qualified URL If the URI is already fully qualified, it is simply returned
static String toFullyQualifiedURL(RequestContext context, String uri)
          Converts a relative URI to a fully qualified URL If the URI is already fully qualified, it is simply returned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebUtil

public WebUtil()
Method Detail

getQueryStringMap

public static Map getQueryStringMap(javax.servlet.http.HttpServletRequest request)
Creates a Map of query string key and value parameters from the given request

Parameters:
request - the request
Returns:
the query string map

getQueryStringMap

public static Map getQueryStringMap(String queryString)
Creates a Map of query string key and value parameters from the given query string. Values are decoded using the default encoding.

Parameters:
queryString - the query string
Returns:
the query string map

getQueryStringMap

public static Map getQueryStringMap(String queryString,
                                    String encoding)
Creates a Map of query string key and value parameters from the given query string. Values are decoded using the specified encoding. If the specified encoding is null, not decoding is applied.

Parameters:
queryString - the query string
Returns:
the query string map

getQueryStringForMap

public static String getQueryStringForMap(Map map)
Returns the query string for a given map of key and value pairs

Parameters:
map - the map
Returns:
the query string for map

toFullyQualifiedURL

public static String toFullyQualifiedURL(RequestContext context,
                                         String uri)
Converts a relative URI to a fully qualified URL If the URI is already fully qualified, it is simply returned

Parameters:
context -
uri -
Returns:
the fully qualified url

toFullyQualifiedURL

public static String toFullyQualifiedURL(javax.servlet.http.HttpServletRequest request,
                                         String uri)
Converts a relative URI to a fully qualified URL If the URI is already fully qualified, it is simply returned

Parameters:
request -
uri -
Returns:
the fully qualified url


Copyright © 2009 SpringSource, Inc. All Rights Reserved.