Details
Description
Struts replicates a design flaw in commons-chain where command lookups are done
relative only to the static singleton instance of CatalogFactory. Instead,
wherever possible, object instances should have a "catalogFactory" property
which, while it may default to being set to the static instance, could also be
overridden with any subtype of CatalogFactory.
This should make it more practical to initialize chains using some mechanism
other than Digester – although we would then want to consider how Struts
bootstraps its chains, a process whici is currently hardcoded into the
ActionServlet. If one wanted to use Spring to create chains and a
CatalogFactory, should one be able to tell Struts not to bother? Or do we just
accept that it will run through the Digester-based XML parse and ignore the
static CatalogFactory instance when we are also using some other bootstrap
mechanism?