Integration steps:
1. Create a project
2. Change the coding of the entire project to UTF-8 format.
3. encode the entire jsp page into UTF-8 format.
4. Import the required jar package to the lib directory of the WEB-INF
-Struts
-Hibernate
-Spring
-Db
-Junit
5. Create three src folder
5.1 src stores source code
-Domain
-Dao
-Impl
-Service
-Impl
-Action
5.2 config stores all configuration files
-Struts2
-Hibernate
-Spring
-ApplicationContext. xml
ApplicationContext-db.xml
5.3 test store test cases
6. Write interfaces and classes in the corresponding packages of dao and service layers
7. Write sessionFactory in the applicationContext-db.xml File
8. Create a new class SessionFactoryTest in the test package to test whether SessionFactory is correctly configured.
9. Write spring declarative Transaction Processing
10. Write dao and service in the spring configuration file
11. Test declarative transaction processing using the savePerson Method
12. Write action
13. Compile the struts2 configuration file
14. Compile a web. xml file
14.1 web. xml configuration
Spring containers are integrated with tomcat in the form of listeners.
<Listener>
<Listener-class> org. springframework. web. context. ContextLoaderListener </listener-class>
</Listener>
<Context-param>
<Param-name> contextConfigLocation </param-name>
<Param-value> classpath: spring/applicationContext. xml </param-value>
</Context-param>
15. Test