Tag files in JSP 2.0 look and run like normal JSP files with some extra
directives. This example definine a tag attribute "a" which
String value. It prints a simple message.
The extension identifies the tag as a JSP tag file using XML syntax. The example could also have used for a tag file in JSP syntax. Tag files normally belong in WEB-INF/tags, although the location is configurable.
The tag example uses the JSP 2.0 Expression Language as an example and
as a way to avoid any Java in the tag file. The
tells the tag to look in the
pageContext for a local
a. The value of
a is assigned by
the tag attribute as defined in the attribute directive.
Using tag files is similar to using normal JSP tags. This example uses the XML syntax, although normal JSP syntax would work, too. The namespace prefix tells JSP where to look for the tag. In this case it will look in WEB-INF/tags.