Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ObjectFactory has the sole responsibility of creating objects needed by Struts2. It is how Struts2 does its integration All objects created by the framework are instantiated by the ObjectFactory. The ObjectFactory provides the means of integrating the framework with IoC containers like Spring, Pico, Plexus etc, and so forth.

Customize

Note

Customized ObjectFactory must extend ObjectFactory or any of its descendants and have a default, no-argument constructor.

To have register a customized ObjectFactory, have the following add or edit an entry in struts.properties

Code Block
 struts.objectFactory=foo.bar.MyCustomObjectFactory

...