net.spy.jwebkit
Class RequestUtil

java.lang.Object
  extended by net.spy.jwebkit.RequestUtil

public final class RequestUtil
extends java.lang.Object

Miscellaneous request utilities.


Method Summary
static java.lang.String getQueryString(javax.servlet.http.HttpServletRequest req)
          Get the QUERY_STRING that can be used to reconstruct the current request.
static java.lang.String getRelativeUri(javax.servlet.http.HttpServletRequest req, java.lang.String uri)
          Get a relative URI inside the current web app.
static java.util.Map<java.lang.String,java.lang.String[]> parseQueryString(java.lang.String s, java.lang.String charset)
          Parse the given query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRelativeUri

public static java.lang.String getRelativeUri(javax.servlet.http.HttpServletRequest req,
                                              java.lang.String uri)
Get a relative URI inside the current web app.

Parameters:
req - a servlet request
uri - A uri (beginning with /) within the webapp
Returns:
the relative URI, absolute to the web app

getQueryString

public static java.lang.String getQueryString(javax.servlet.http.HttpServletRequest req)
Get the QUERY_STRING that can be used to reconstruct the current request.

Parameters:
req - the request object
Returns:
a String that can be appended to the the relative or absolute URL to reconstruct the URL (without the initial ?)

parseQueryString

public static java.util.Map<java.lang.String,java.lang.String[]> parseQueryString(java.lang.String s,
                                                                                  java.lang.String charset)
Parse the given query string.

Parameters:
s - the string to parse
charset - the character set in which to parse the string
Returns:
a Map of keys to array values
Throws:
java.lang.IllegalArgumentException - if the input doesn't make for a valid query string


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.