Java Reference
In-Depth Information
Entering the tag file name into the first field will result in the value of the Created
File field to be filled automatically, default values for all other fields are sensible and
in most cases there is no need to modify them.
At this point, NetBeans creates an initial tag file that we can use as a starting point.
<%@tag description="put the tag description here"
<%-- The list of normal or fragment attributes can be specified here:
<%@attribute name="message"%>
<%-- any content can be specified here e.g.: --%>
Tag files can contain one or more tag directives. The tag directive is similar to
the page directive in a JSP. The generated tag directive contains two attributes, a
description attribute used to describe the purpose of the tag, and a pageEncoding
attribute used to set the page encoding of the tag.
The attribute directive allows us to specify what attributes may be sent from the
JSP using our tag.
Using the above markup as a starting point, we will now create a tag file that will
generate an HTML table containing a series of input fields for entering an address:
<%@tag description="Address Input Field" pageEncoding="UTF-8"%>
<jsp:useBean id="addressBean" scope="session"
<%@ taglib prefix="c" uri="<%-- The list
of normal or fragment attributes can be specified here: --%>
<%@attribute name="addressType" required="true" %>
<table cellpadding="0" cellspacing="0" border="0">
<td>Line 1:&nbsp;</td>
<input type="text" size="20"
<td>Line 2:&nbsp;</td>
Search WWH ::

Custom Search