The following steps show how to create a tag file in a web application. After you create
the tag file, use code completion in the Source Editor to specify the tag's attributes, body, and behavior.
To create a tag file:
In the Projects window or Files window, right-click the project node.
From the pop-up menu, choose New > Other.
Under Categories, select Web. Under File Types, select Tag File. Click Next.
Type the name of the tag file.
Type the folder where your tag files are housed. By default, they are created in WEB-INF/tags.
Select the type of tag file that you want to create:
Tag File (Standard Syntax). Tag files written using
the standard JSP syntax.
typically have the .tag extension.
Tag File (XML Syntax). Tag files written
using the XML document syntax
typically have the
.tagx extension. Two examples of the advantages that XML document syntax
has over standard JSP syntax are:
You can edit, verify, and view files in XML document syntax with XML capable tools,
such as the IDE's Source Editor.
You can transform files in XML document syntax using XSLT tools, such
as the IDE's XSL Transformation command.
(Optional) Click the Create as a Segment of a Tag File checkbox.
A segment is a file that contains a fragment of tag file text for inclusion
by tag files. Tag segments typically use the .tagf extension.
(Optional) Click the Add Tag File to Tag Library Descriptor checkbox if
you want the IDE to create entries in a TLD file for the tag file.
If you click this checkbox, you must have a TLD file available. If not, create
one first.
If you clicked the Add Tag File to Tag Library Descriptor checkbox,
do the following:
Click Browse to select the tag library descriptor (TLD file) for your
tag file. By default, the TLD files are in the WEB-INF/tlds folder.
Type the name of the tag. This is the name you use in the JSP file to refer
to the tag file.
Click Finish.
The IDE creates a tag file that conforms to the JSP 2.0 specification.
A tag file is run when the JSP file in which it is defined
is deployed. You can set breakpoints in the tag file.
Then, when the JSP file is debugged, the tag
file is debugged too.
For more information about creating and using tag libraries, see the JavaServer
Pages Specification available
at