Object
Cloneable
Class for creating URLs from parameterized templates. This mechanism recognizes the following parameters in URL templates:
url:scheme | Scheme | Usage |
url:domain | Domain | May be set |
url:port | Port | May be set |
url:path | Extra path information | Reserved, must be present in a template. |
url:queryString | Reserved query parameters | Reserved, must be present in a template. |
Field Summary |
public static final |
|
protected |
|
protected |
|
public static final |
|
public static final |
|
protected |
|
public static final |
|
public static final |
|
public static final |
|
Constructor Summary |
|
Method Summary |
public void |
|
public |
|
public |
|
public boolean |
|
public |
|
public |
|
public |
|
public int |
|
public | |
public |
|
public |
|
public |
|
public boolean |
|
public void |
|
public void | |
public void |
|
public void | |
public void |
|
public void |
|
public void |
|
public void | |
public void |
|
public void | |
public |
|
Methods from class java.lang. |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String
CONTROL_STATE_PARAM
Control state parameter (reserved).
protected HttpServletRequest
httpRequest
HTTP request.
protected HttpServletResponse
httpResponse
HTTP response<./p>
public static final String
MODE_PARAM
Window mode query parameter (reserved).
public static final String
PAGE_LABEL_PARAM
Page label query parameter (reserved).
protected LinkedHashMap
params
Query parameters
public static final String
POSTBACK_PARAM
Postback request query parameter (reserved).
public static final String
STATE_PARAM
Window state query parameter (reserved).
public static final String
WINDOW_LABEL_PARAM
Window label query parameter (reserved).
Constructor Detail |
public TemplateHelper(HttpServletRequest
httpRequest,HttpServletResponse
httpResponse)
Constructs a GenericURL
.
Method Detail |
public void addParameter(String
name,String
value)
Add a parameter. Multiple values for the same parameter can be set by calling this method multiple times with the same name.
public Object
clone()
Returns a deep copy.
Object.clone()
public String
getDomain()
Returns the domain. If no domain was previously set, returns the domain that was used to make the current request.
public boolean getEncodeSession()
Returns true
if URL rewriting is enabled.
publicString
getParameter(String
name)
Returns the value of the parameter. If the parameter has several values, returns the first value.
publicList
getParameters(String
name)
Returns the values of the given parameter.
public String
getPathPrefix()
Returns the path prefix.
public int getPort()
Returns the port. If no port was previously set, returns the port that was used to make the current request.
public String
getQueryString()
public String
getScheme()
Returns the protocol scheme. If no protocol was previously set, returns the protocol that was used to make the current request.
public String
getTemplate()
Returns the current template.
publicString
getTemplateName(String
templateRef)
public boolean hasTemplateRef(String
templateRef)
public void removeParameter(String
name)
Removes the given parameter.
public void setDomain(String
domain)
Sets the domain. If a domain is not specified, the domain that was used to make the current request will be used.
public void setEncodeSession(boolean encodeSession)
Enables URL rewriting for encoding a session ID in the
URL. If not set to true
, does not encode the URL
with the session ID. Default is true
.
public void setPath(String
path)
Sets path.
public void setPathPrefix(String
pathPrefix)
Sets a path prefix.
public void setPort(int port)
Sets a port. If a port is not specified, the port that was used to make the current request will be used.
public void setQueryString(String
queryString)
public void setScheme(String
scheme)
Sets the protocol scheme. Should be one of "HTTP" or "HTTPS". If a protocol is not specified, the protocol that was used to make the current request will be used.
public void setTemplate(String
templateName)
Sets a URL template for this URL.
public void setUrl(String
url)
public String
toString()
Returns a string form (fully-quanlfied) of this URL.
Object.toString()