1.配置监听器( web.xml)
< listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>自己spring的xml路径</param-value>
</context-param>
2.struts +srping +hibernate的结合
在struts-config中的Action中把type属性的值指向spring的DelegatingActionProxy类
eg:
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
在spring中注入strut和hibernate
<bean name="/login" class="com.der.struts.action.LoginAction">
<property name="user">
<ref bean="UserDAO"/>
</property>