Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > ObjectFactory
Added by tm_jee, last edited by Ted Husted on Feb 12, 2007  (view change)

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, and so forth.


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

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


where foo.bar.MyCustomObjectFactory is the custom object factory.

public class MyObjectFactory extends ObjectFactory {

Next: ActionMapper