O'Reilly logo

Sams Teach Yourself J2EE™ in 21 Days by Peter Roxburgh, Andy Longshaw, Debbie Law, Dan Haywood, Martin Bond

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Developing a Simple Custom Tag

A custom tag is made up of two components:

  • A Java class file that implements the tag

  • An entry in a Tag Library Descriptor (TLD) file that defines the tag's name, its implementing Java class, and additional information necessary to deploy and use the tag

Using a custom tag requires a reference to the Tag Library Descriptor (TLD) at the start of the JSP. Multiple Tag Libraries can be used on the same Web page. After the TLD has been referenced, the custom tag from the TLD can be used like any other JSP tag.

Using a Simple Tag

To start learning to write and use TagLibs, you will implement a very simple custom tag that writes “Hello World” onto your Web page. This isn't a good use of a custom tag, but it will help you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required