Chapter 2. CUSTOM TAG ADVANCED CONCEPTS

Topics in this Chapter

  • Body Tag Handlers

  • Iteration

  • Scripting Variables

    • Storing Beans in Page Scope

    • Specifying Scripting Variable Information

    • Associating a Tag Handler and Scripting Variables

    • Using Custom Tag IDs

  • Body Content

    • Understanding How Body Content Works

    • Generating JavaScript

  • Nested Tags

    • Locating Ancestor Tags

    • Sharing Data

  • Conclusion

Sophisticated custom tags often manipulate their body content; for example, a custom tag could wrap its body content in an HTML SELECT tag, so that tag might be used like this—

<html:links name='api'>
   <option value='Servlets'>servlets</option>
   ...
</html:links>

—and end up producing HTML like this:

 <select name='api' onChange='this.form.submit()'> <option value='Servlets'>servlets</option> ...

Get Advanced JavaServer Pages™ 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.