Posts

Showing posts with the label Object Factory

Object Factory

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. Customize Extend ObjectFactory 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 struts.objectFactory=foo.bar.MyCustomObjectFactory where foo.bar.MyCustomObjectFactory is the custom object factory. public class MyObjectFactory extends ObjectFactory {      ..... } Define dedicated factory If you want to just extend one part of ObjectFactory, ie. to change how Result Types are build, you can implement ResultFactory interface and register it with dedicated name, see Extension Points for more details. Original ObjectFactory will use these dedicated factories t...