|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--sunlabs.brazil.template.Template
|
+--sunlabs.brazil.template.ModifiedTemplate
Template class for computing last-modified times
for content that is processed through templates.
For traditional web content that is stored in a file, it is easy to
keep track of the last time the content changed, simply by looking at the
modify-time attribute of the file. Many browsers (and caches) use
this information,
obtained from the last-modified http header to determine
whether to use an existing copy of the document, or a cached copy.
When the content is dynamically transformed, however, the last modified time is more complex: a combination of the original file modification time combined with the last change made to the transformation parameters.
A new HTML tag,
<modified> is defined, and is intended to be
used in conjunction with the BSLTemplate. When present in a
page, the last-modified time of the transformation
is set to the server's current time. When the content is delivered
to the client, the last-modified header is set to the
more recent of the origin last-modified time and the transformation
modified time.
Properties:
modified
tag is replaced by a comment. Otherwise it is removed from the document.
| Field Summary |
| Fields inherited from class sunlabs.brazil.template.Template |
debug |
| Constructor Summary | |
ModifiedTemplate()
|
|
| Method Summary | |
boolean |
done(RewriteContext hr)
Compute the http last modified value by comparing the origin last-modified value (if any) with the transform value |
void |
tag_modified(RewriteContext hr)
Set the content transformation modifiy time to NOW |
| Methods inherited from class sunlabs.brazil.template.Template |
init |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ModifiedTemplate()
| Method Detail |
public void tag_modified(RewriteContext hr)
public boolean done(RewriteContext hr)
done in interface TemplateInterfacedone in class Template
|
Version 2.1, Generated 12/30/04 Copyright (c) 2001-2004, Sun Microsystems. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||