Chapter 11. Creating Your Own Tag Libraries

In this chapter, we show you how to create custom tag libraries. We focus particularly on creating tag libraries that work well with the JSTL tag library. By designing your tag libraries so that they can deal with JSTL scoped variables and the JSP 1.3 expression language (EL), you will be able to create tag libraries that easily integrate with JSTL code.

Tag libraries allow you to take procedures that would be lengthy to write using just JSTL and encapsulate them in a tag. One perfect example of this is the JSTL SQL tags. It is generally not a good idea to put SQL database code in JSP pages. Database code is an implementation detail that should be separated from the presentation-oriented JSP pages. The ...

Get JSTL: JSP Standard Tag Library Kick Start 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.