| Template class for highlighting text that matches a regular expression.
All text between html/xml entities is matched against a regular expression.
For each portion of text that matches the expression, a pair of
html/xml tags is added on either side of all matched text.
Highlighting is automatically turned off inside of head, script, style,
and server tags.
Properties. These are recomputed for every page that
highlight changes.
- highlight
- A regular expression that with match any text
between entities.
- tag
- the html/xml tag pair that will be added before and
after all text maching "highlight", above. The
default is "<font> ..... </font>
- options
- the set of name=value options that will be added
to the starting tag of the tag pair, above. The
default is "color=red".
- matchCase
- If specifies, matched are case sensitive.
The default is to ignore case when matching.
- substitute
- The string to substitute for the matched text.
This is for advanced uses. If specified, the values
for
tag and options are
ignored. The default is:
<${tag} ${options}>&</${tag}>
The format of the string is a regular expression
substitution string, which supports ${} style
variable substitutions from the request properties.
- mustHighlight
- If not set, the entire document is surrounded
by implicit
highlight tags. If set
no highlighting will take place until an actual
highlight tag is present.
- exit
- If set, the template "init" method will
return false, and no further processing will
take place. This is useful if this template
is used by itself.
The following html tags are processed:
- highlight
- /highlight
- Only text between these tags is considered for highlighting.
- nohighlight
- /nohighlight
- Temporarily undoes the effect of a
highlight tag.
In the current implementation, highlight and
nohighlight don't nest.
author: Stephen Uhler version: 1.11 HighlightTemplate.java %V% 0 |