| java.lang.Object org.apache.turbine.util.uri.BaseURI org.apache.turbine.util.uri.DataURI
DataURI | public class DataURI extends BaseURI implements URIConstants(Code) | | This class can convert a simple link into a turbine relative
URL. It should be used to convert references for images, style
sheets and similar references.
The resulting links have no query data or path info. If you need
this, use TurbineURI or TemplateURI.
author: Henning P. Schmiedehausen version: $Id: DataURI.java 534527 2007-05-02 16:10:59Z tv $ |
Method Summary | |
public void | clearResponse() Content Tool wants to be able to turn the encoding
of the servlet container off. | public String | getAbsoluteLink() Builds the URL with all of the data URL-encoded as well as
encoded using HttpServletResponse.encodeUrl(). | public String | getRelativeLink() Builds the URL with all of the data URL-encoded as well as
encoded using HttpServletResponse.encodeUrl(). | public String | toString() toString() simply calls getAbsoluteLink. |
DataURI | public DataURI()(Code) | | Empty C'tor. Uses Turbine.getDefaultServerData().
|
DataURI | public DataURI(RunData runData)(Code) | | Constructor with a RunData object
Parameters: runData - A RunData object |
DataURI | public DataURI(RunData runData, boolean redirect)(Code) | | Constructor, set explicit redirection
Parameters: runData - A RunData object Parameters: redirect - True if redirection allowed. |
DataURI | public DataURI(ServerData serverData)(Code) | | Constructor with a ServerData object
Parameters: serverData - A ServerData object |
DataURI | public DataURI(ServerData serverData, boolean redirect)(Code) | | Constructor, set explicit redirection
Parameters: serverData - A ServerData object Parameters: redirect - True if redirection allowed. |
clearResponse | public void clearResponse()(Code) | | Content Tool wants to be able to turn the encoding
of the servlet container off. After calling this method,
the encoding will not happen any longer.
|
getAbsoluteLink | public String getAbsoluteLink()(Code) | | Builds the URL with all of the data URL-encoded as well as
encoded using HttpServletResponse.encodeUrl(). The resulting
URL is absolute; it starts with http/https...
TurbineURI tui = new TurbineURI (data, "UserScreen");
tui.addPathInfo("user","jon");
tui.getAbsoluteLink();
The above call to absoluteLink() would return the String:
http://www.server.com/servlets/Turbine/screen/UserScreen/user/jon
A String with the built URL. |
getRelativeLink | public String getRelativeLink()(Code) | | Builds the URL with all of the data URL-encoded as well as
encoded using HttpServletResponse.encodeUrl(). The resulting
URL is relative to the webserver root.
TurbineURI tui = new TurbineURI (data, "UserScreen");
tui.addPathInfo("user","jon");
tui.getRelativeLink();
The above call to absoluteLink() would return the String:
/servlets/Turbine/screen/UserScreen/user/jon
A String with the built URL. |
toString | public String toString()(Code) | | toString() simply calls getAbsoluteLink. You should not use this in your
code unless you have to. Use getAbsoluteLink.
This URI as a String |
|
|