Developing exteNd Director Applications

CHAPTER 17

Working with JSP pages

This chapter describes how to use the exteNd Director tag libraries with JavaServer Pages (JSP). It includes the following topics:

 
Top of page

About JSP pages and the exteNd Director tag libraries

exteNd Director provides a set of custom tag libraries for use with JavaServer Pages (JSP). These tags wrap many of the most commonly used methods in the exteNd Director API.

Tag library JAR files   The exteNd Director tag libraries are distributed in the following JAR files:

For complete details on using tags in this file

See

ContentMgmtTag.jar

The tag library reference in the Content Management Guide

FrameworkTag.jar

The tag library reference in the User Management Guide

PortalTag.jar

The tag library reference in the Portal Guide

RuleTag.jar

The tag library reference in the Rules Guide

WorkflowTag.jar

The tag library reference in the Workflow Guide

TLD files   Each of these JAR files has an associated tag library descriptor (TLD) file. The TLD file is an XML file that describes the tags in the library.

The exteNd Director tag libraries are described in the following TLD files:

To use a custom tag library, you need to include the tag library JAR file and the associated TLD file in the WAR that contains your JSP pages.

Where to put your JSP pages    You should package your JSP pages in the WAR for your Web application, along with your exteNd Director resources. But the JSP pages should be at the root of the WAR, or in a subdirectory of the root. They should not be stored inside the resource set, or anywhere inside the WEB-INF/lib directory.

For more information    For complete details on JSP and the Java Servlet API, see the Sun documentation.

 
Top of page

Adding the JAR and TLD files to your project

When you use the Director Project Wizard to create your WAR file, you can select the tag libraries you need for your application. The JAR and TLD files you need are automatically added to the project:

The web.xml file for the WAR file maps the tag library URIs to the included TLD files, as shown below:

  <web-app>
  ...
  
   <taglib>
    <taglib-uri>/cm</taglib-uri>
    <taglib-location>/WEB-INF/tag/ContentMgmtTag.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>/fw</taglib-uri>
    <taglib-location>/WEB-INF/tag/FrameworkTag.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>/portal</taglib-uri>
    <taglib-location>/WEB-INF/tag/PortalTag.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>/re</taglib-uri>
    <taglib-location>/WEB-INF/tag/RuleTag.tld</taglib-location>
   </taglib>
   <taglib>
    <taglib-uri>/wf</taglib-uri>
    <taglib-location>/WEB-INF/tag/WorkflowTag.tld</taglib-location>
   </taglib>
  
  ...
  </web-app>

 
Top of page

Using a custom tag in a JSP page

Procedure To use a custom tag in a JSP page:

  1. Add a tag library directive to the page to notify the server that the page relies on a custom tag library. Once you have added this directive to the page, all tags in the library are available to the page. Here's an example of a tag library directive that makes the tags described in the PortalTag.tld file available to the page:

      <%@ taglib uri="/portal" prefix="ep" %>
    

    This example assumes the web.xml file for the WAR file maps the URI to an appropriate TLD file. Here the URI /portal is mapped to /WEB-INF/lib/PortalTag.tld:

      <web-app>
      ...
       <taglib>
        <taglib-uri>/portal</taglib-uri>
        <taglib-location>/WEB-INF/lib/PortalTag.tld</taglib-location>
       </taglib>
      
      </web-app>
    
  2. Add the custom tag to the page.

    Here's an example that shows how to display a PID page on a JSP page:

      <ep:displayPID PID="MyPID.html" />
    


Copyright © 2004 Novell, Inc. All rights reserved. Copyright © 1997, 1998, 1999, 2000, 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.  more ...