在spring的配置文件中添加
<bean id="spring-object-factory"
class="com.opensymphony.xwork.spring.SpringObjectFactory"
init-method="initObjectFactory"/>
然后在spring的配置文件中定义bean.例如:
<bean name="some-action"
class="fully.qualified.class.name" singleton="false">
<property name="someProperty"><ref bean="someOtherBean"/></property>
</bean>
在xwork.xml中引用,例如:
<action name="myAction" class="some-action">
<result name="success">view.jsp</result>
</action>