JSP Tag Libraries

Скачать в pdf «JSP Tag Libraries»


To summarize, as your tag will not be complete without a validating TagExtrainfo, create one.

Document your tags’ usage


Tag documentation is not composed of Javadocs. The users of your tags are not intended to be Java programmers, and the Javadocs are not going to make any sense for them.


The tag’s documentation should be more akin to a reference manual, wherein you explain the tag in terms of its functionality, usage, and attributes. For each tag attribute you want to specify the attribute’s functionality—whether it is a required attribute, whether it can accept runtime values, what the expected values are, and so forth. Also specify other parameters affecting the tag, such as the application and page-based configuration parameters and the J2EE environment values, and provide a few tag usage samples.


By reading this documentation, the HTML developer (remember, little or no Java background) will know how to use your tag. Documentation that describes advanced features that can only be understood by a fellow Java programmer should be kept in a different document or labeled “advanced topics.”


We are not professing that you should never Javadoc your tags, nor are we warning you to stay away from Javadoc, the tool. In fact, by developing a few custom doclets (Javadoc extension components), you should be able to draw the user level documentation you need using Javadoc.

Design your tags with usability in mind


The user of your tag is probably a veteran HTML coder who will feel comfortable using tags; nevertheless, most users don’t like tags with too many attributes and overly complex functionality. Imagine what would happen if you created a tag with six or seven attributes and complex relationships between attributes. Most users cannot overcome that many possible attribute value combinations. This means:

Скачать в pdf «JSP Tag Libraries»