So far, you have seen tags that treat the text in the body of the tag as simple JSP (or HTML) data. But tags can also manipulate the tag body in any way they choose. A simple example would be a tag that interprets its body as an SQL statement and uses this to query the database. Listing 14.18 shows a simple use of such a tag.
1: <%@ taglib uri="/demo" prefix="demo" %> 2: <HTML> 3: <HEAD> 4: <TITLE> Tag Library SQL Query Demo</TITLE> 5: <BODY> 6: <demo:select> 7: SELECT * FROM Customer 8: </demo:select> 9: </BODY> 10: </HTML>
The implementation of this select tag must state in the TLD that the body text is tag dependent, as shown in the following:
<tag> <name>select</name> <tag-class>demo.SelectTag</tag-class> ...