| Apache Struts 2 Plugin Registry > 2008 > 03 > 09 > Resin-IoC 3.1.5 plugin |
Resin 3.1.5 now contains a Struts2 ObjectFactory plugin, enabling Resin-IoC capabilities for any Struts2 action. Documentation is available at http://wiki.caucho.com/Struts2
.
To enable Resin-IoC with Struts, you'll need to copy the resin/ext/resin-support.jar to either WEB-INF/lib or resin/ext-webapp. And you'll need to create or modify WEB-INF/classes/struts.properties as follows:
# Tell struts to ask Resin for new action instances struts.objectFactory = com.caucho.xwork2.ResinObjectFactory
public class ResinObjectFactory extends ObjectFactory { private WebBeansContainer _webBeans = WebBeansContainer.create(); @Override public Object buildBean(Class clazz, Map extraContext) { return _webBeans.getObject(clazz); } }