O'Reilly logo

J2EE™ Applications and BEA™ WebLogic Server™ by Sandra L. Emerson, Rob Woollen, Michael Girdley

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

Custom Tag Libraries

Custom tag libraries, added to JSP in Version 1.1, enable developers to encapsulate complex functionality inside of HTML-like tags. Basically, you can write your own action tags. If you remember from earlier in this chapter, actions are JSP tags for using implicit objects and other server-side objects, and for defining new scripting variables. They typically take the form of <jsp: action name/>. A Web developer can use these tags from a custom tag library just like any other HTML or JSP tag.

Using Custom Tag Libraries in JSP

Custom tag libraries are designed to hide complexity behind simple JSP tags. The following JSP code (main.jsp) demonstrates just how simple they are to use:

 <%@ taglib uri="tlds/stockPrice.tld" prefix="stock" ...

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