O'Reilly logo

Struts Kick Start by Kevin Bedell, James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The struts-config DTD

A good first look at the file can be gotten by looking at the DTD for the XML (see Listing 10.1). The full file (for Struts version 1.1) can be found on the Jakarta Web site at

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd

Listing 10.1. A Portion of the struts-config.xml DTD
<!ELEMENT struts-config (data-sources?, form-beans?,
                         global-exceptions?, global-forwards?,
                         action-mappings?, controller?,
                         message-resources*, plug-in*)>

One reason that it’s important to take a look at the DTD is that the parameters in the config file (like most XML files) are order-dependent, so it’s crucial to put the subelements in the correct order. Now we’ll consider each element in turn.

READING DTDS

If you haven’t been exposed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required