Using Custom Tags in JSP

With JSP version 1.1, custom tag libraries were introduced. These tag libraries provide a facility for creating custom JSP page tags. They provide a facility in which a common, well-understood approach to page programming, the page tag, can be used to access custom behaviors programmed in Java.

Tags provide a great deal of flexibility and are very effective in hiding the specifics of the operation from the user. For this reason, tags are an excellent mechanism for providing access to business logic to the HTML developer.

These tags resemble HTML tags in the use of a tag name, tag attributes, and a tag body, using the following syntax:

 <myTag:tagName attribute1="value" attribute2="value"> optional tag body </myTag:tagName> ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.