org.apache.turbine.util
Class RelativeDynamicURI

java.lang.Object
  extended byorg.apache.turbine.util.DynamicURI
      extended byorg.apache.turbine.util.RelativeDynamicURI
All Implemented Interfaces:
URI
Direct Known Subclasses:
RelativeTemplateLink

Deprecated. Use TurbineURI with TurbineURI.getRelativeLink() instead.

public class RelativeDynamicURI
extends DynamicURI

This creates a Dynamic URI for use within the Turbine system

If you use this class to generate all of your href tags as well as all of your URI's, then you will not need to worry about having session data setup for you or using HttpServletRequest.encodeUrl() since this class does everything for you. This class generates relative URI's which can be used in environments with firewalls and gateways for outgoing connections.

 RelativeDynamicURI dui = new RelativeDynamicURI (data, "UserScreen" );
 dui.setName("Click Here").addPathInfo("user","jon");
 dui.getA();
 
The above call to getA() would return the String: <A HREF="/servlets/Turbine/screen=UserScreen&amp;user=jon">ClickHere</A>

Version:
$Id: RelativeDynamicURI.java 264148 2005-08-29 14:21:04Z henning $
Author:
David S. Faller

Field Summary
 
Fields inherited from class org.apache.turbine.util.DynamicURI
data, hasPathInfo, hasQueryData, HTTP, HTTPS, PATH_INFO, pathInfo, QUERY_DATA, queryData, redirect, reference, res, sd
 
Constructor Summary
RelativeDynamicURI()
          Deprecated. Default constructor - one of the init methods must be called before use.
RelativeDynamicURI(RunData data)
          Deprecated. Constructor sets up some variables.
RelativeDynamicURI(RunData data, boolean redirect)
          Deprecated. Constructor sets up some variables.
RelativeDynamicURI(RunData data, java.lang.String screen)
          Deprecated. Constructor sets up some variables.
RelativeDynamicURI(RunData data, java.lang.String screen, boolean redirect)
          Deprecated. Constructor sets up some variables.
RelativeDynamicURI(RunData data, java.lang.String screen, java.lang.String action)
          Deprecated. Constructor sets up some variables.
RelativeDynamicURI(RunData data, java.lang.String screen, java.lang.String action, boolean redirect)
          Deprecated. Constructor sets up some variables.
RelativeDynamicURI(ServerData sd)
          Deprecated. Main constructor for RelativeDynamicURI.
RelativeDynamicURI(ServerData sd, boolean redirect)
          Deprecated. Main constructor for RelativeDynamicURI.
RelativeDynamicURI(ServerData sd, java.lang.String screen)
          Deprecated. Main constructor for RelativeDynamicURI.
RelativeDynamicURI(ServerData sd, java.lang.String screen, boolean redirect)
          Deprecated. Main constructor for RelativeDynamicURI.
RelativeDynamicURI(ServerData sd, java.lang.String screen, java.lang.String action)
          Deprecated. Main constructor for RelativeDynamicURI.
RelativeDynamicURI(ServerData sd, java.lang.String screen, java.lang.String action, boolean redirect)
          Deprecated. Main constructor for RelativeDynamicURI.
 
Method Summary
 java.lang.String toString()
          Deprecated. Builds the relative URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl().
static java.lang.String toString(RunData data)
          Deprecated. Given a RunData object, get a relative URI for the request.
 
Methods inherited from class org.apache.turbine.util.DynamicURI
add, add, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addPathInfo, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, addQueryData, assertInitialized, getA, getContextPath, getReference, getScriptName, getServerData, getServerName, getServerPort, getServerScheme, init, init, remove, removePathInfo, removePathInfo, removeQueryData, removeQueryData, renderPathInfo, renderQueryString, setAction, setActionEvent, setContextPath, setReference, setScreen, setScriptName, setSecure, setSecure, setServerData, setServerName, setServerPort, setServerScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelativeDynamicURI

public RelativeDynamicURI()
Deprecated. 
Default constructor - one of the init methods must be called before use.


RelativeDynamicURI

public RelativeDynamicURI(RunData data)
Deprecated. 
Constructor sets up some variables.

Parameters:
data - A Turbine RunData object.

RelativeDynamicURI

public RelativeDynamicURI(RunData data,
                          java.lang.String screen)
Deprecated. 
Constructor sets up some variables.

Parameters:
data - A Turbine RunData object.
screen - A String with the name of a screen.

RelativeDynamicURI

public RelativeDynamicURI(RunData data,
                          java.lang.String screen,
                          java.lang.String action)
Deprecated. 
Constructor sets up some variables.

Parameters:
data - A Turbine RunData object.
screen - A String with the name of a screen.
action - A String with the name of an action.

RelativeDynamicURI

public RelativeDynamicURI(RunData data,
                          java.lang.String screen,
                          java.lang.String action,
                          boolean redirect)
Deprecated. 
Constructor sets up some variables.

Parameters:
data - A Turbine RunData object.
screen - A String with the name of a screen.
action - A String with the name of an action.
redirect - True if it should redirect.

RelativeDynamicURI

public RelativeDynamicURI(RunData data,
                          java.lang.String screen,
                          boolean redirect)
Deprecated. 
Constructor sets up some variables.

Parameters:
data - A Turbine RunData object.
screen - A String with the name of a screen.
redirect - True if it should redirect.

RelativeDynamicURI

public RelativeDynamicURI(RunData data,
                          boolean redirect)
Deprecated. 
Constructor sets up some variables.

Parameters:
data - A Turbine RunData object.
redirect - True if it should redirect.

RelativeDynamicURI

public RelativeDynamicURI(ServerData sd)
Deprecated. 
Main constructor for RelativeDynamicURI. Uses ServerData.

Parameters:
sd - A ServerData.

RelativeDynamicURI

public RelativeDynamicURI(ServerData sd,
                          java.lang.String screen)
Deprecated. 
Main constructor for RelativeDynamicURI. Uses ServerData.

Parameters:
sd - A ServerData.
screen - A String with the name of a screen.

RelativeDynamicURI

public RelativeDynamicURI(ServerData sd,
                          java.lang.String screen,
                          java.lang.String action)
Deprecated. 
Main constructor for RelativeDynamicURI. Uses ServerData.

Parameters:
sd - A ServerData.
screen - A String with the name of a screen.
action - A String with the name of an action.

RelativeDynamicURI

public RelativeDynamicURI(ServerData sd,
                          java.lang.String screen,
                          java.lang.String action,
                          boolean redirect)
Deprecated. 
Main constructor for RelativeDynamicURI. Uses ServerData.

Parameters:
sd - A ServerData.
screen - A String with the name of a screen.
action - A String with the name of an action.
redirect - True if it should redirect.

RelativeDynamicURI

public RelativeDynamicURI(ServerData sd,
                          java.lang.String screen,
                          boolean redirect)
Deprecated. 
Main constructor for RelativeDynamicURI. Uses ServerData.

Parameters:
sd - A ServerData.
screen - A String with the name of a screen.
redirect - True if it should redirect.

RelativeDynamicURI

public RelativeDynamicURI(ServerData sd,
                          boolean redirect)
Deprecated. 
Main constructor for RelativeDynamicURI. Uses ServerData.

Parameters:
sd - A ServerData.
redirect - True if it should redirect.
Method Detail

toString

public java.lang.String toString()
Deprecated. 
Builds the relative URL with all of the data URL-encoded as well as encoded using HttpServletResponse.encodeUrl().

 RelativeDynamicURI dui = new RelativeDynamicURI (data, "UserScreen" );
 dui.addPathInfo("user","jon");
 dui.toString();
 
The above call to toString() would return the String:

/servlets/Turbine/screen/UserScreen/user/jon

Overrides:
toString in class DynamicURI
Returns:
A String with the built relative URL.

toString

public static java.lang.String toString(RunData data)
Deprecated. 
Given a RunData object, get a relative URI for the request. This is necessary sometimes when you want the relative URL and don't want RelativeDynamicURI to be too smart and remove actions, screens, etc. This also returns the Query Data where RelativeDynamicURI normally would not.

Parameters:
data - A Turbine RunData object.
Returns:
A String with the relative URL.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.