|
Prerequisites |
To successfully build the JAKARTA-TAGLIBS custom tag libraries and
Custom Tag Library Extensions (CTLX), you must download and install the
following software components (where $JAKARTA_HOME refers to a directory
into which you download and install the various Jakarta software components):
|
Download and Installation |
Source downloads of the JAKARTA-TAGLIBS distribution, as with all other
Jakarta projects, are available from the Jakarta web site at
http://jakarta.apache.org/site/sourceindex.html.
Download and unpack the JAKARTA-TAGLIBS distribution (from the link above)
into a subdirectory named jakarta-taglibs under the
$JAKARTA_HOME directory described above. For example, you
might end up with the following directory structure:
$JAKARTA_HOME/
jakarta-ant/ <-- Contains source distribution of Ant
dist/ <-- Contains binary distribution of Ant
lib/ <-- Binary libraries directory
ant.jar <-- Ant executable classes
jakarta-servletapi/ <-- Contains binary distribution of Servletapi
lib/ <-- Binary libraries directory
servlet.jar <-- Servlet API classes
jakarta-taglibs/ <-- Contains source distribution of the
JAKARTA-TAGLIBS libraries
... see below for details ...
jakarta-tomcat/ <-- Contains Tomcat (if you are using it)
|
Directory Structures |
The distribution archive will contain the following file and directory
structure:
- .cvsignore - A CVS configuration file configuring what files
and directories to ignore when using CVS.
- LICENSE - A copy of the Apache Software Foundation
license under which all Jakarta project software is distributed.
- README - A brief README file that contains pointers
to the documentation that is available.
- HOWTO-RELEASE - Documentation about the JAKARTA-TAGLIBS release
process.
- build.properties.sample - An example Ant properties file used
to set properties for the location of jar files for API's needed to
build jakarta-taglibs.
- build.xml - An XML file for Ant that describes the build process
for building all of the included custom tag libraries. See the Ant
documentation for more information about the contents of this file.
- common.xml - An XML file for Ant that implements common build
processes used for building individual tag libraries.
- common.properties - A properties file for Ant used by common.xml.
- doc/ - A directory containing static documentation about the
JAKARTA-TAGLIBS subproject, including this file. The following
documents are included:
- src/ - A directory containing source files for dynamically building
jakarta-taglibs tag libraries and documentation. The following files and
directories are included:
- doc/ - A directory containing source files for dynamically
building the http://jakarta.apache.org/taglibs web site
- index.xml - Content used to build
http:/jakarta.apache.org/taglibs/index.html
- addtaglib.xml - Content used to build
http:/jakarta.apache.org/taglibs/addtaglib.html
- binarydist.xml - Content used to build
http:/jakarta.apache.org/taglibs/binarydist.html
- guidelines.xml - Content used to build
http:/jakarta.apache.org/taglibs/guidelines.html
- sourcedist.xml - Content used to build
http:/jakarta.apache.org/taglibs/sourcedist.html
- tutorial.xml - Content used to build
http:/jakarta.apache.org/taglibs/tutorial.html
- project.xml - Content used to build left navigation menu
for http:/jakarta.apache.org/taglibs/ documentation
- taglibs_docs.dtd - DTD for use with index.xml and taglib intro.xml
- images/jakarta-logo.gif - The Jakarta logo
- images/taglibs.gif - The JAKARTA-TAGLIBS logo
- stylesheets/taglibs.xsl - Transform content xml into
http:/jakarta.apache.org/taglibs/ documentation
- taglib/ - A directory containing common source files used to
dynamically build individual tag library documentation and Tag Library
Descriptor (TLD) file.
- changes-doc.xsl - XSL stylesheet used to build taglib documentation changes.html
- examples.xsl - XSL stylesheet used to build example war file jsp source html
- taglib-doc.xsl - XSL stylesheet used to build taglib documentation
- tld11.xsl - XSL stylesheet used to build taglib TLD file
- taglib-template/ - Directory containing a template of directories and files
for a taglib which can be used when creating a new taglib
- build.xml - Template for an example build file
- doc - Source directory used to generate {taglib-name}-doc.war
- doc/conf/web.xml - Template for {taglib-name}-doc web application web.xml
- examples - Source directory used to generate {taglib-name}-examples.war
- examples/conf/web.xml - Template for {taglib-name}-examples web application web.xml
- xml/intro.xml - Template for taglib XML data used for generating
taglib intro.html documentation which is published to the JAKARTA-TAGLIBS site
- xml/taglib-template.xml - Template for taglib XML data for taglib and tags
- A directory for each custom tag library included in the JAKARTA-TAGLIBS
project, where the directory name matches the short name of that project.
A Custom Tag Library Extension (CTLX) will be located in the appropriate
tools/{tool}/{version} directory.
Each directory will contain the following files and subdirectories
- build.xml - An XML file that describes the build process for
this particular custom tag library. See the Ant documentation for
more information on the contents of this file.
- doc/ - The source code (Java classes, resource files, HTML
pages, JSP pages, and so on) for a web application that will contain
the developer documentation for this tag library. This web application
will be combined into a
{taglib}-doc.war web
application archive in the binary distribution. See below for more
information about the internal directory structure of web applications.
- examples/ - The source code (Java classes, resource files,
HTML pages, JSP pages, and so on) for a web application that
demonstrates the use of custom tags within this custom tag library.
This web application will be combined into a
{taglib}-examples.war web application archive in the
binary distribution. See below for more information about the
internal directory structure of web applications.
- src/ - The Java source code and resource files of the classes
that comprise this custom tag library. The internal directory
arrangement within the source directory must reflect the assignment
of classes to Java packages, in the usual manner. To avoid name
clashes, the package name for each custom tag library should be
org.apache.taglibs.{taglib} so that multiple
JAKARTA-TAGLIBS can be used in the same application if desired.
- xml/ - A directory containing XML data files used for
building taglib documentation and Tag Library Descriptor (TLD) file.
- intro.xml - XML data used for generating taglib intro.html
documentation which is published to the JAKARTA-TAGLIBS site.
- {taglib-name}.xml - XML data for taglib and tags used for
generating taglib documentation and TLD file.
Within the doc/ and examples/ subdirectories for each custom
tag library, the following directory organization is used to contain the source
components of this application:
- conf/ -- The
web.xml file for this application, plus
any other files that should be copied to the WEB-INF subdirectory.
- src/ -- The Java source code and resource files for this
application. Package names are arbitrary, but we recommend using
org.apache.taglibs.{taglib}.doc for the documentation
application, and org.apache.taglibs.{taglib}.examples
for the example application.
- web/ -- The HTML and JSP pages that comprise this application's
user interface. The
index.html or index.jsp
page in this directory will be the "home" page of the application when
it is deployed in a servlet container.
|
Building JAKARTA-TAGLIBS |
To build the distribution version of all included custom tag libraries,
set your current directory to the jakarta-taglibs directory into
which you unpacked the distribution.
- Copy the file
build.properties.sample to
build.properties .
- Edit
build.properties and set the jar file properties
to the absolute path and filename for the jar files required to build
all the JAKARTA-TAGLIBS.
- Build all the JAKARTA-TAGLIBS by executing
ant in a shell.
In addition to the directories described earlier, two additional directory
hierarchies will be created to contain the results of the build:
jakarta-taglibs/
build/ <-- Contains intermediate form results of
building JAKARTA-TAGLIBS custom libraries
dist/ <-- Contains the files that will be included
in the binary distribution of the
JAKARTA-TAGLIBS project, as described in
binary distribution documentation
When you are working on a particular custom tag library, it is faster to
rebuild only that particular library while doing development. To do this,
change to the top level directory of that custom tag library (for example,
change to the jakarta-taglibs/jspspec directory to work on the
JSP Specification Examples custom tag library. You can now use one of several
variants of the Ant build, depending on what you want to do. In
each of the following cases use ant in a shell to execute
a build of the taglib for a specific ant build target:
NOTE:
Some individual tag libraries may still need to be built using the
build.sh shell script for unix or the build.bat
DOS script.
- Default -- Update the intermediate form (in the
build/ directory) of the library itself, the
documentation application, and the example application. This copies any
static files that have been changed, and recompiles any Java source classes
that have been changed. Because this is the most commonly executed
command, it is the default.
- library -- Update the intermediate form of the library
classes only. This is useful when you are making sure it still compiles.
- documentation -- Update the intermediate form of the
documentation application. If your servlet container can accept an
unpacked web application (as Tomcat can), the
build/{taglib}/doc/ directory can be set
as the document root, and the application can be executed directly.
- examples -- Update the intermediate form of the examples
application (including copying the library classes into WEB-INF/classes).
If your servlet container can accept an unpacked web application (as Tomcat
can), the
build/{taglib}/examples/ directory can
be set as the document root, and the application can be executed directly.
- library-dist -- Build and copy the
{taglib}.jar
and {taglib}.jar files for this tag library into the
distribution directory (dist/{taglib}/ ).
These distribution files can be copied directly into web applications
that wish to use this custom tag library.
- documentation-dist -- Build the
{taglib}-doc.war
documentation application, and copy it into the distribution directory
(dist/{taglib}/ ). This application can be
deployed and executed on any servlet container.
- examples-dist -- Build the
{taglib}-examples.war
examples application, and copy it into the distribution directory
(dist/{taglib}/ ). This application can
be deployed and executed on any servlet container.
- dist -- Short cut command that builds all three
distribution targets (
library-dist , documentation-dist ,
and examples-dist ).
- clean -- Deletes the intermediate and distribution results
for this custom tag library, so that you can rebuild from scratch.
The following directory and files are created when doing a build:
- build/{taglib-name}/ - Location of all directories and
files built for the taglib.
- build/{taglib-name}/{taglib-name}/ - Compiled java class files
for taglib which are used to create the
{taglib-name}.jar file.
- build/{taglib-name}/{taglib-name}-doc/ - Files used to create
the
{taglib-name}-doc.war file and the intro.html file
which gets published to
http://jakarta.apache.org/taglibs/doc/{taglib-name}-doc/intro.html.
- build/{taglib-name}/{taglib-name}-examples/ - Files used to create
the
{taglib-name}-examples.war file.
The following directory and files are created when doing a distribution build:
- dist/{taglib-name}/ - Location of all files built for a binary
distribution of the taglib.
- dist/{taglib-name}/taglibs-{taglib-name}.jar - Jar of java classes for tag library.
- dist/{taglib-name}/taglibs-{taglib-name}.tld - Tag Lib Descriptor for tag library.
- dist/{taglib-name}/{taglib-name}-doc.war - Tag Library documentation war file.
- dist/{taglib-name}/{taglib-name}-examples.war - Tag Library examples war file.
When you perform a global build, the dist build target is invoked
on each included subproject.
Refer to the Adding a Taglib for information
on how to add a new JSP Custom Tag Library or Extensions to JAKARTA-TAGLIBS.
|
|