Home » tapestry-src-5.0.19 » org.apache.tapestry5 » [javadoc | source]
public interface: Link [javadoc | source]

All Known Implementing Classes:

A link is the Tapestry representation of a URL or URI that triggers dynamic behavior. This link is in three parts: a path portion, an optional anchor, and a set of query parameters. A request for a link will ultimately be recognized by a org.apache.tapestry5.services.Dispatcher .

Query parameter values are kept separate from the path portion to support encoding those values into hidden form fields (where appropriate).
Method from org.apache.tapestry5.Link Summary:
addParameter,   getAnchor,   getParameterNames,   getParameterValue,   setAnchor,   toAbsoluteURI,   toRedirectURI,   toURI
Method from org.apache.tapestry5.Link Detail:
 public  void addParameter(String parameterName,
    String value)
    Adds a parameter value. The value will be added, as is, to the URL. In many cases, the value should be URL encoded via URLCodec .
 public String getAnchor()
    Returns the link anchor. If this link does not have an anchor, this method returns null.
 public List<String> getParameterNames()
    Returns the names of any additional query parameters for the URI. Query parameters store less regular or less often used values that can not be expressed in the path. They also are used to store, or link to, persistent state.
 public String getParameterValue(String name)
    Returns the value of a specifically named query parameter, or null if no such query parameter is stored in the link.
 public  void setAnchor(String anchor)
    Sets the link anchor. Null and empty anchors will be ignored when building the link URI.
 public String toAbsoluteURI()
    Converts the link to an absolute URI, a complete path, starting with a leading slash. This is necessary in many cases for client-side JavaScript that must send a request to application via XMLHttpRequest.
 public String toRedirectURI()
    Returns the link as a redirect URI. The URI includes any query parameters.
 public String toURI()
    Returns the URI portion of the link. When the link is created for a form, this will not include query parameters. This is the same value returned from toString(). In some circumstances, this may be a relative URI (relative to the current Request's URI).