在struts-config.xml里面
写一个
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="ContextConfigLocation" value="/WEB-INF/applicationContext.xml">
</plug-in>
<action-mappings>里面的 <action>的type="org.springframework.web.struts.DelegatingActionPorxy"
在applicationContext.xml中 把DAO注入到action中
<bean name="/user" class="com.you.XAction">
<property name="dao" ref="DAO"></property>
</bean>