Chapter 4. Configuring Struts Applications
The Struts framework uses two separate but somewhat related types of configuration files, which must be configured properly before an application will work correctly. Due to the popularity, flexibility, and self-describing nature of XML, both types of configuration files are based on XML.
The web application deployment descriptor named web.xml is described fully in the Java Servlet specification.[5] This configuration file is necessary for all web applications, not just those built with the Struts framework. However, there is Struts-specific deployment information within it that must be configured when building Struts applications.
Tip
Although the Struts framework supports the 2.2 Servlet specification, many servlet containers already have support for Version 2.3. This book includes coverage of the 2.2 and 2.3 specifications.
The second configuration file that we will examine is the Struts configuration file. It is commonly named struts-config.xfile , but you can name it just about anything you want. The Struts configuration file makes it possible for you to declaratively configure many of your application’s settings. You can think of the Struts configuration file as the rules for the web application.
The Storefront Application
Throughout the rest of this book, we will construct a shopping-cart type application to use for all of the examples. By the end of the book, we should have a fairly complete application that uses most of the Struts ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access