1.6. Managing Struts Configuration Files
Problem
You want to avoid typographical errors in the various Struts configuration files and make editing and maintenance of these files easier.
Solution
Use a tool like Struts Console for viewing and editing the Struts configuration files.
Discussion
One of the most common causes of errors in web applications is
typographical mistakes. In general, most modern software
applications—Struts included—rely on configuration files
and deployment descriptors in some form of ASCII text, typically XML.
Using a validating XML editor can help alleviate mistakes; however,
it does not eliminate the mistyped path, form-bean
name, or class name.
The Struts Console, available for download at http://www.jamesholmes.com, provides a graphical editor for the Struts (struts-config.xml), Validator (validation.xml and validator-rules.xml), and Tiles (tiles-defs.xml) configuration files. Instead of hand-editing these files, you use the Swing-based editor provided by Struts Console. In addition to reducing the typos, Struts Console gives you a birds-eye view of these files for easier browsing. You will find this feature invaluable when your configuration files start to get large.
Struts Console provides "smart"
graphical editors for the XML-based configuration files used in
Struts development. Figure 1-2 is the view of the
struts-config.xml file for the
struts-example application.
Figure 1-2. Struts Console viewing the Struts sample application
The Editor tab presents two ...