Now that we have described the example application that will be the basis of this chapter’s discussion, it’s time to start looking at how we can implement it using the Struts framework. Although Chapter 1 discussed the MVC pattern in the order of model, view, and then controller, it doesn’t necessarily make sense to follow that order as we explore the Struts components. In fact, it’s more logical to cover the components in the order in which the Struts framework uses them to process a request. Thus, we’ll discuss the components that make up the controller portion of the framework first.
The Struts framework is made up of approximately 300 Java classes, divided into 8 core packages (“approximately” is an appropriate term because the framework is continuously growing and being shaped). In this chapter, we’ll focus on only the top- level packages. Figure 3-4 shows the top-level packages and their dependencies within the framework.
Figure 3-4. The eight top-level packages in the Struts framework
shown in Figure 3-4 does not represent the entire
set of classes and interfaces necessary for the
Validator framework. These are only
the Struts-specific extensions necessary to use the Validator
framework with Struts. There is also a ninth top-level package named
config, which consists of a single Java class. We’ll ...