steps:struts or hibernate is first is ok
1:struts or hibernate and test it
2:add spring
Be careful: jar conflict . Don't use commons-dbcp.jar in struts, but spring's. or it will occur Exception.
Details:
1.add spring container: config in web.xml(context-param) or struts(plug-in)
<!-- 加载spring容器(context-param) -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/classes/applicationContext-*.xml</param-value>
</context-param>
<!-- 监听容器(context)创建 -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
2.config action
careful:<bean name="/add" class="***">,only here use "name" but not "id" on the attribute of bean
web.xml configer
struts.cfg.xml
applicationcontext-dao.xml
applicationcontext-service.xml