Chapter 5. Creating a Custom Tag Library for Displaying Errors and Sending Email

In this chapter

  • What You Are Going To Do

  • Incorporating Custom Tags

  • Next Steps

In the preceding chapters, you saw how to provide reusability in your JSPs using include mechanisms and JavaBeans. In this chapter, you will learn about a new mechanism for generating dynamic content in JSP 1.1 called tag libraries. The tag library feature allows you to invent your own custom HTML-like tags for your JSPs. You then need to back your tags with Java code that is executed when the JSP container encounters the custom tag. In this way, your JSP generates content using simple custom tags instead of Java code interspersed in scriptlets. Custom tags also fully demarcate ...

Get Java Server Pages from scratch 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.