Struts2 架構:ObjectFactory [筆記]
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.
框架創建的所有對象都是有ObjectFactory實例化的。ObjectFactory提供了和其他IoC框架整合的方法。
Customize
![]() |
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
Samuel說:在struts.xml中可以指定objectfactory="spring"
struts.objectFactory=foo.bar.MyCustomObjectFactory
where foo.bar.MyCustomObjectFactory is the custom object factory.
public class MyObjectFactory extends ObjectFactory {
.....
}
posted on 2007-04-29 15:47 MingIsMe 閱讀(1068) 評論(0) 編輯 收藏 所屬分類: Struts2學習