|Home > Guides > Contributors Guide > Requirements > Use Cases > Zero Configuration Scanning|
One of Zaphod's heads is allergic to XML. Rather than embed metadata in a configuration file, Zaphod annotates his POJO actions instead. The framework scans the designated packages for objects that implement Action or have names that end with "Action". An action mappings is automatically created and registered for each matching class, based on the annotations.
(User Goal, Summary, Subfunction)
System loads FilterDispatcher through web.xml, which includes actionPackages parameter
FilterDispatcher initializes a Dispatcher, passing along the actionPackages parameter
Dispatcher initializes ClasspathConfigurationProvider to hold one or more Configuration Providers
Dispatcher adds to the ConfigurationManager object a ClasspathConfigurationProvider to process the actionPackages.
(someone) calls loadpackages on ClasspathConfigurationProvider
loadpackages utilizes the XWork ResolverUtil to find classes that implement Action or have names suffixed with "Action" in the listed packages. Each found class is added to a set (if not already present), and each class in the set is passed to the processActionClass helper method.
processActionClass ascertains the namespace, captures any ParentPackage or Results annotations, and creates an ActionConfig, setting the action name, package name, and results.
The action name is truncated before any Action suffix.
If action name contains a / character, then the first character after the last / is forced to lowercase.
On the fly results
Results are wrapped in a ResultMap class that processes the Action class annotations on initialization, creating any new result configuration objects as needed.