sunlabs.brazil.template
public class Template extends Object implements TemplateInterface
In the future, various "dummy" subclasses may be used as alternate parents to indicate which session behavior is expected.
In the current implementation, access to each instance is restricted to one thread at a time. In many situations this is a good compromise between ease of coding templates and server performance. As a new instance is created for each session, multiple threads may be active at once, although only one per session.
In the future, it is expected that an alternative mode of running templates will be available that will remove the current synchonization lock around each template instance, allowing multiple threads to access each instance at once.
To take advantage of this new scheme
templates should be written
thread safe. They should avoid using instance variables
if possible. If state needs to be passed among methods, it may
be stored in the RewriteContext
, as each thread has its own.
Configuration properties:
debug
debug
property is associated with the template prefix, the value of
debug
with the prefix for the class registering this
template is used instead.
UNKNOWN: %W
Field Summary | |
---|---|
boolean | debug |
Method Summary | |
---|---|
protected void | debug(RewriteContext hr, String msg)
Add a diagnostic comment to html output, if "debug" is set
in the request properties. |
protected void | debug(RewriteContext hr)
Add current tag as a comment to the html |
boolean | done(RewriteContext hr)
Called after all tags have been processed, one final chance. |
boolean | init(RewriteContext hr)
Called before this template processes any tags. |
Parameters: msg The message to include as a comment