sunlabs.brazil.sunlabs
Class FetchTemplate
public
class
FetchTemplate
extends Template
Template class for substituting html pages into an html page.
This class is used by the TemplateHandler. This does not perform
traditional server-side include processing, whose normal purpose is to
include standard headers and footers. That functionality is provided
instead by including the content into the template, and not the other
way around.
This include incorporates entire pages from other sites, either directly
as part of the page content, or into a property, for further processing.
NOTE: This version depends on the behavior of JDK1.4. It does not
use the Brazil Request class, but the URL class instead. Thus
it has advantages that it automatically follows some redirects, and can
handle additional protocols, such as "https" and "ftp", but it does
not cache connections, and the proxy may not be set of a per request
basis. Attributes:
- href
- Absolute url to fetch, and insert here
- post
- Post data if any. If set, an http POST is issued.
The post data is expected to be in www-url-encoded format.
- alt
- Text to insert if URL can't be obtained.
- name
- The name of the variable to put the result in.
If this is specified, the content is not included in place.
- proxy
- The proxy:port to use as a proxy (if any).
If specified, it overrides the
proxy
property,
in request.props
.
- getheaders
- The name of the variable prefix to use to
extract the http response headers.
If this not specified, no response headers are retrieved.
The result will be properties of the form:
[getheaders].[header_name]=[header_value]
.
If multiple entries exist for a particular header name, the values
are combined as per HTTP conventions (e.g. v1, v2, ... vn).
The pseudo header status
will contain the http status line.
Note: This used to be called the IncludeTemplate, but was
renamed to avaoid confusion with the other IncludeTemplate.
Version: @(#)FetchTemplate.java 1.5
Author: Stephen Uhler