- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class HighlightTag
extends javax.servlet.jsp.tagext.BodyTagSupport
HighlightTag
The highlight tag is used to wrap a certain string in a body
of text with an html tag. Example usage:
<rhn:highlight tag="foo" text="test">
This is a test body of text.
</rhn:highlight>
Result: This is a <foo>test</foo> body of text.
<rhn:highlight startTag="<foo color=blue>"
endTag="</foo>" text="test">
This is a test body of text.
</rhn:highlight>
Result: This is a <foo color=blue>test</foo> body of text.
<rhn:highlight tag="font" startTag="<foo color=blue>" text="test">
This is a test body of text.
</rhn:highlight>
Result: This is a <foo color=blue>test</foo> body of text.
Note: This is currently *not* to be used with formatted text. For example, If I
had the following:
<rhn:highlight tag="foo" text="as">
This is a <div class="bar">test</div> body of text.
</rhn:highlight>
we would get the result:
This is a <div cl<foo>as</foo>s = "bar" >test</div>
body of text.
It would be cool if this tag was smart enough to tell whether or not it was inside
of a tag and if so, skip the matching text, but that will have to wait for a future
version.
- See Also:
- Serialized Form