You must download the latest version of Commons Digester and place
the Commons Digester JAR
in your
project’s classpath. Following the steps outlined in
Recipe 1.1, download Commons Digester 1.5
instead of Commons Lang. Uncompress the distribution archive and
place commons-digester.jar
in your classpath.
Commons Digester depends on Commons BeanUtils, Commons Logging, and
Commons Collections. To download dependencies, see Recipe 3.2, Recipe 5.1, and Recipe 7.9.
Commons Digester started as a part of Jakarta Struts, and it was
moved to the Jakarta Commons project by way of the Commons Sandbox in
early 2001. Digester is the mechanism Struts uses to read XML
configuration; struts-config.xml
is the main
configuration point for Jakarta Struts, and it is converted to a set
of objects using the Digester. The Digester’s most
straightforward application is the mapping of an XML document to a
set of Java objects, but, as shown in this chapter and Chapter 12, Digester can also be used to create a
simple XML command language and search index. Digester is a shortcut
for creating a SAX parser. Almost anything you can do with a SAX
parser can be done with Jakarta Commons Digester.
If you have a Maven project that needs to use Commons Digester, add a
dependency on Commons Digester 1.5 with the following section in
project.xml
:
<dependencies> <dependency> <id>commons-digester</id> <version>1.5</version> </dependency> ....other dependencies... </dependencies>
For more information about Commons Digester, see the Commons Digester project page at http://jakarta.apache.org/commons/digester. For information about using the Digester to create a Lucene index, see Chapter 12.
18.191.165.62