Using Custom Actions in JSP 2.0

The JavaServer Pages (JSP) 1.1 specification introduced custom actions (or custom tags as they’re frequently called). You can use custom actions for encapsulating the Java functionality you may frequently need on a JSP page; they allow you to use this functionality as markup. A custom action is really nothing more than a Java class that implements some specific interfaces. You can think of custom actions as view helper classes. You’ll see as you progress through this chapter that in JSP 2.0, it’s now possible to write custom actions completely in JSP syntax if you choose. You use custom actions so that your JSP pages can remain free of Java code. By creating a custom action and defining a descriptor file for it, you can take advantage of code reuse, debug functionality once, and provide a consistent mechanism for access across your JSP files.