SECTION 11: DESIGNING AND DEVELOPING JSP PAGES USING CUSTOM TAGS

Section 11
11.1 Identify properly formatted tag library declarations in the Web application deployment descriptor.
11.2 Identify properly formatted taglib directives in a JSP page.
11.3 Given a custom tag library, identify properly formatted custom tag usage in a JSP page. Uses include:
  • An empty custom tag
  • A custom tag with attributes
  • A custom tag that surrounds other JSP code
  • Nested custom tags

Section 11 - Designing and Developing JSP pages Using Custom Tags

11.1 Identify properly formatted tag library declarations in the Web application deployment descriptor.


taglib*, <!ELEMENT taglib (taglib-uri, taglib-location)>
<web-app> 
    <taglib> 
        <taglib-uri> http://www.jspinsider.com/jspkit/javascript </taglib-uri> 
        <taglib-location> /WEB-INF/JavaScriptExampleTag.tld </taglib-location> 
    </taglib> 
</web-app>

11.2 Identify properly formatted taglib directives in a JSP page.


<%@ taglib uri="http://jakarta.apache.org/taglibs/datetime-1.0" prefix="dt" %>
- uri can be defined in web.xml or can be directly pointing to the TLD. 
- prefix is used in the jsp to reference the tag. ( local namespace)

11.3 Given a custom tag library, identify properly formatted custom tag usage in a JSP page. Uses include:

  1. An empty custom tag
  2. A custom tag with attributes
  3. A custom tag that surrounds other JSP code
  4. Nested custom tags

    An empty custom tag  - <msgBean:message/>
    A custom tag with attributes  - <msgBean:message attrName="value" />
    A custom tag that surrounds other JSP code 
      <msgBean:message> <h1>This is the title</h1> </msgBean:message>
    Nested custom tags
      <msgBean:message> <helloBean:sayHello/> </msgBean:message>

Return to top