org.apache.tapestry.services
Interface BaseURLSource
- All Known Implementing Classes:
- BaseURLSourceImpl
public interface BaseURLSource
Used when switching between normal/insecure (HTTP) and secure (HTTPS) mode. When a switch occurs, it is no longer
possible to use relative URLs, instead absolute URLs must be generated. The default implementation of this is
simple-minded: it just tacks the correct scheme in front of Request.getServerName().
In production, behind a firewall, it is often necessary to do a bit more, since getServerName() will
often be the name of the internal server (not visible to the client web browser), and a hard-coded name of a server
that is visible to the web browser is needed. Further, in testing, non-default ports are often used. In
those cases, an overriding contribution to the Alias service will allow a custom
implementation to supercede the default version.
|
Method Summary |
String |
getBaseURL(boolean secure)
Returns the base portion of the URL, before the context path and servlet path are appended. |
getBaseURL
String getBaseURL(boolean secure)
- Returns the base portion of the URL, before the context path and servlet path are appended. The return value
should not end with a slash; it should end after the host name, or after the port number. The context
path, servlet path, and path info will be appended to the returned value.
- Parameters:
secure - whether a secure "https" or insecure "http" base URL should be returned
- Returns:
- the base URL ready for additional extensions
Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.