1 / 18

Chapter 7

Chapter 7. Using Custom Tag Libraries and the JSP Standard Tag Library. What Is a Custom Tag Library?. Custom Actions Usage access to all information about the request add content to the response body as well as set response headers

candy
Download Presentation

Chapter 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 7 Using Custom Tag Libraries and the JSP Standard Tag Library

  2. What Is a Custom Tag Library? • Custom Actions • Usage • access to all information about the request • add content to the response body as well as set response headers • use any Java API to access external resources such as databases, email servers, etc. • <prefix:tag atttribute=“value” />

  3. Custom Tag Implementations • Java Classes

  4. Custom Tag Implementations • Tag files (An example)

  5. Custom Tag Library Tag Library Descriptor (TLD) JAR Custom Tag Implementations

  6. Installing a Custom Tag Library • place the JAR file for the library in the WEB-INF/lib directory for the web application

  7. Prefix use any prefix you like except jsp, jspx, java, javax, servlet, sun, or sunw Uri When the web application is started, the container scans through the WEB-INF directory structure for files with .tld extensions and all JAR files containing files with .tld extensions in their META-INF directory Declaring a Custom Tag Library

  8. Declaring a Custom Tag Library • Relation between the taglib directive, the TLD, and the implementation (tag handler) for the custom actions

  9. Identifying a Custom Tag Library in a JSP 1.1 Container • WEB-INF/web.xml • <%@ taglib uri="/WEB-INF/lib/orataglib_3_0.jar" prefix="ora" %>

  10. Using Actions from a Tag Library

  11. Setting Action Attribute Values • Action attributes can be of any Java type • Automatic type conversion

  12. The JSP Standard Tag Library • URI for the JSTL 1.1 libraries

  13. JSTL functions

  14. JSTL functions

  15. JSTL functions

  16. JSTL Reference Implementation JAR files

  17. JSTL Reference Implementation JAR files

  18. Using Beans or Custom Actions • a bean is a great carrier of information • a custom action is great for processing information • Custom actions can use beans as input and output

More Related