4.7 The Digester Component


When a Struts application is initialized, one of the first things that it must do is to read and parse the configuration file, which, as you've seen in this chapter, is in XML. The Digester component is a separate Jakarta project made up of several classes that read XML files and create and initialize Java objects based on those files.

The Digester component uses a set of rules, written as a Java class, to invoke callback methods. These methods instantiate and populate the objects with data read from the Struts configuration file.

The Struts framework uses the Digester to parse the configuration files and to create the necessary configuration objects within the org.apache.struts.config package. The rules that the Digester uses for Struts are contained within the org.apache.struts.config.ConfigRuleSet class. There is little need to modify the ConfigRuleSet class unless you need to extend the configuration file. If this is necessary for your application, you should view the documentation for the Digester component before you get started. This can be found at http://jakarta.apache.org/commons/digester.html.



Programming Jakarta Struts
Programming Jakarta Struts, 2nd Edition
ISBN: 0596006519
EAN: 2147483647
Year: 2003
Pages: 180

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net