You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

ObjectFactory has the sole responsibility of creating objects needed by Struts2. It is how Struts2 does its integration with IoC containers like Spring, Pico, Plexus etc.

Customize

Customized ObjectFactory must extend ObjectFactory or any of its descendants and have a default constructor.

To have a customized ObjectFactory, have the following entry in struts.properties

 struts.objectFactory=foo.bar.MyCustomObjectFactory

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

public class MyObjectFactory extends ObjectFactory {
    .....
}
  • No labels