Custom Tags (also known as Custom Actions) extend JavaServer Pages’ ability to divide development responsibilities between backend business component developers and front-end presentation designers. Custom Tags enable component developers to encapsulate complex business functionality into XML-like tags that are as simple to use for a page designer as HTML’s BODY tag. This tutorial will demonstrate the development of a functioning custom tag library from initial concept to fully deployed tag library.
Attendees will Learn:
How to create a sophisticated set of JSP Tags, package them into a Tag Library, and deploy them in a Web Archive file.
Tutorial Outline:
- Introduction to JSP Actions
- Custom Actions and their Lifecycle
- Demo: Custom action development
- Simple tag introduction: What it will do, how it will work.
- Introduction to JSP Tag API
- Demo: Construction and compilation of simple tag
- Tag Library Descriptor (TLD) file introduction
- Demo: Creation of TLD for Tutorial Tag Library
- Packaging custom tags into Tag Libraries
- Demo: Creation of WAR for our tag
- Deployment of tag library package
- Demo: Deploy our set of tags
- Custom Tag use
- Tag library directive
- Demo: Custom tag use in a JSP Tag
- Use of tags in JSP scripting
- Demo: Addition of code to simple tag, use of tag in JSP
- Nested and cooperating tags - why would you use this?
- Demo: Use of nested and cooperating tags to set of tags being developed
- How nested tags work - Iteration.
- Demo: Addition of nested and cooperating tag code to our set of tags
- Demo: Update of TLD
- Demo: Re-packaging and re-deployment of custom tag library
- Use of nested tags in JSPs
- Demo: Use of nested and cooperating tags in JSP
- Help for TagLibs: Special considerations for design technologists and page designers
- Demo: Creation of help for our tutorial tag library
- Questions
Prerequisites:
The tutorial is aimed at Intermediate to advanced Java developers with an understanding of JavaServer Pages.