com.opensymphony.web
Class ContextGenerator

java.lang.Object
  |
  +--com.opensymphony.web.ContextGenerator

public class ContextGenerator
extends java.lang.Object

This class is a utility class to handle encoding of a given URL (presented as a string).

Version:
$Revision: 1.2 $
Author:
Joseph B. Ottinger

Constructor Summary
ContextGenerator(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Constructor for the ContextGenerator object
 
Method Summary
 java.lang.String getUrl()
          Gets the Url attribute of the ContextGenerator object.
 java.lang.String getUrl(java.lang.String url)
          Gets the Url attribute of the ContextGenerator object
 void setUrl(java.lang.String url)
          Sets the Url attribute of the ContextGenerator object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextGenerator

public ContextGenerator(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse resp)
Constructor for the ContextGenerator object
Parameters:
req - The request object from the current servlet context
resp - The response object from the current servlet context
Method Detail

setUrl

public void setUrl(java.lang.String url)
Sets the Url attribute of the ContextGenerator object
Parameters:
url - The new Url value

getUrl

public java.lang.String getUrl(java.lang.String url)
Gets the Url attribute of the ContextGenerator object
Parameters:
url - the url to encode
Returns:
The Url value

getUrl

public java.lang.String getUrl()
Gets the Url attribute of the ContextGenerator object. If the url has a protocol specifier, the url is returned unchanged. Otherwise, the url should have the session id appended properly (if required).
Returns:
The encoded url value

See www.opensymphony.com for more information.