com.arsdigita.util
Class URLRewriter

java.lang.Object
  extended bycom.arsdigita.util.URLRewriter

public class URLRewriter
extends Object

Re-writes URLs to include additional parameters that come from a set of registered ParameterProviders. This makes cookieless login possible, by re-writing URLs to include a session ID parameter.


Field Summary
static String versionId
           
 
Constructor Summary
URLRewriter()
           
 
Method Summary
static void addParameterProvider(ParameterProvider provider)
          Adds a parameter provider.
static void clearParameterProviders()
          Clears all parameter providers.
static String encodeRedirectURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String url)
          Encodes the given URL for redirecting the client.
static String encodeURL(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp, String url)
          Encodes the given URL for the client.
static Set getGlobalModels()
          Returns the set of global parameter models, or the empty set if no provider is set.
static Set getGlobalParams(javax.servlet.http.HttpServletRequest req)
          Returns the set of global URL parameters for the given request, or the empty set if no provider is set.
static String prepareURL(String url, javax.servlet.http.HttpServletRequest req)
          Deprecated. This method does not encode the servlet session ID. Use encodeURL(req, res, url) instead.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

URLRewriter

public URLRewriter()
Method Detail

addParameterProvider

public static void addParameterProvider(ParameterProvider provider)
Adds a parameter provider.


clearParameterProviders

public static void clearParameterProviders()
Clears all parameter providers.


getGlobalModels

public static Set getGlobalModels()
Returns the set of global parameter models, or the empty set if no provider is set.

Returns:
a set of bebop ParameterModels

getGlobalParams

public static Set getGlobalParams(javax.servlet.http.HttpServletRequest req)
Returns the set of global URL parameters for the given request, or the empty set if no provider is set.

Returns:
a set of bebop ParameterData

encodeRedirectURL

public static String encodeRedirectURL(javax.servlet.http.HttpServletRequest req,
                                       javax.servlet.http.HttpServletResponse resp,
                                       String url)
Encodes the given URL for redirecting the client. Adds ACS global parameters and servlet session parameters to the URL. The sendRedirect(req, resp, url) method calls this method automatically.

Returns:
the new URL

prepareURL

public static String prepareURL(String url,
                                javax.servlet.http.HttpServletRequest req)
Deprecated. This method does not encode the servlet session ID. Use encodeURL(req, res, url) instead.

Prepares the given URL for the client. No effect if no provider is set.

Returns:
the prepared URL

encodeURL

public static String encodeURL(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse resp,
                               String url)
Encodes the given URL for the client. Adds ACS global parameters and servlet session parameters to the URL. If the URL will be used for redirection, use sendRedirect(req, resp, url) instead.

Returns:
the new URL


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC