Attributes are used to pass information into a custom tag to configure the behavior of the tag. Tag attributes are like XML or HTML attributes and are name/value pairs of data. The values must be quoted with single or double quotes.
A simple example is a tag that looks up a JNDI name passed in as a parameter. Listing 14.4 shows how such a tag could be used.
1: <%@ taglib uri="/demo" prefix="demo" %> 2: <HTML> 3: <HEAD> 4: <TITLE>Tag Library Lookup Demo</TITLE> 5: <BODY> 6: <demo:lookup name="jdbc/Agency"/> 7: </BODY> 8: </HTML>
The JSP specification allows attributes to have values that can include Java expressions. If the lookup name had been passed in as a request parameter called ...