| java.lang.Object sunlabs.brazil.filter.TemplateFilter
TemplateFilter | public class TemplateFilter implements Filter(Code) | | The TemplateFilter sends HTML content through an
Html/XML parser to a set of Template s. Each Html/XML tag may
dynamically invoke a Java method present in the Template s.
The dynamically-generated content from evaluating the Html/XML tags is
returned to the caller.
The following configuration parameters are used to initialize this
Filter .
-
templates
- A list of
Template class names whose methods will be
invoked by the XML tags present in the content.
-
session
- The request property that contains the session ID. If no
"session" property is found with the supplied prefix, then
the global "session" property is used instead. The default
value is "SessionID".
-
subtype
- Specify the media subtype for this filter to handler. Defaults
to "html" (as in text/html).
The TemplateHandler class is similar, but not identical to
running a FilterHandler with the FileHandler and
the TemplateFilter . The differences between the two should
be resolved.
Note: The templates currently accepts only a list of
class names, and not tokens that could be used to represent
class names. This may be changed in the future. Until then, all
template classes share the TemplateHandler's properties prefix.
author: Stephen Uhler (stephen.uhler@sun.com) author: Colin Stevens (colin.stevens@sun.com) version: 1.22, 00/12/11 |
Method Summary | |
public byte[] | filter(Request request, MimeHeaders headers, byte[] content) Evaluates the content as html/XML tags, if the file is (or has now been
converted to) "text/html". | public boolean | init(Server server, String prefix) | public boolean | respond(Request request) | public boolean | shouldFilter(Request request, MimeHeaders headers) Filters all HTML files, or files that are likely to be html files,
specifically, those whose "Content-Type" starts with "text/". |
filter | public byte[] filter(Request request, MimeHeaders headers, byte[] content)(Code) | | Evaluates the content as html/XML tags, if the file is (or has now been
converted to) "text/html".
|
respond | public boolean respond(Request request)(Code) | | No action before request is made
|
shouldFilter | public boolean shouldFilter(Request request, MimeHeaders headers)(Code) | | Filters all HTML files, or files that are likely to be html files,
specifically, those whose "Content-Type" starts with "text/".
|
|
|