org.apache.tapestry.link
Class AbsoluteLinkRenderer

java.lang.Object
  extended by org.apache.tapestry.link.DefaultLinkRenderer
      extended by org.apache.tapestry.link.AbsoluteLinkRenderer
All Implemented Interfaces:
ILinkRenderer

public class AbsoluteLinkRenderer
extends DefaultLinkRenderer

Renders a link using an absolute URL, not simply a URI (as with DefaultLinkRenderer. In addition, the scheme, server and port may be changed (this may be appropriate when switching between secure and insecure portions of an application).

Since:
3.0
Version:
$Id: AbsoluteLinkRenderer.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Field Summary
 
Fields inherited from class org.apache.tapestry.link.DefaultLinkRenderer
SHARED_INSTANCE
 
Constructor Summary
AbsoluteLinkRenderer()
           
 
Method Summary
protected  String constructURL(ILink link, String anchor, IRequestCycle cycle)
          Converts the EngineServiceLink into a URI or URL.
 int getPort()
           
 String getScheme()
           
 String getServerName()
           
 void setPort(int port)
          Used to override the port in the final URL, if specified.
 void setScheme(String scheme)
          Used to override the scheme in the final URL, if specified.
 void setServerName(String serverName)
          Used to override the server name in the final URL, if specified.
 
Methods inherited from class org.apache.tapestry.link.DefaultLinkRenderer
afterBodyRender, beforeBodyRender, getElement, getHasBody, getUrlAttribute, renderLink
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsoluteLinkRenderer

public AbsoluteLinkRenderer()
Method Detail

getPort

public int getPort()

getScheme

public String getScheme()

getServerName

public String getServerName()

setPort

public void setPort(int port)
Used to override the port in the final URL, if specified. If not specified, the port provided by the request is used (typically, the value 80).


setScheme

public void setScheme(String scheme)
Used to override the scheme in the final URL, if specified. If not specified, the scheme provided by the request is used (typically, http).


setServerName

public void setServerName(String serverName)
Used to override the server name in the final URL, if specified. If not specified, the port provided by the request is used.


constructURL

protected String constructURL(ILink link,
                              String anchor,
                              IRequestCycle cycle)
Description copied from class: DefaultLinkRenderer
Converts the EngineServiceLink into a URI or URL. This implementation simply invokes ILink.getURL(String, boolean).

Overrides:
constructURL in class DefaultLinkRenderer