The construction of the SSH Project source code has been uploaded to Baidu cloud disk. Without maven, download it down, and under ApplicationContext configuration MySQL, execute the next Test.sql script to run it.
Links: http://pan.baidu.com/s/1nvqOcPj
Password: yv19
1. Configure Struts2
A. Copy Struts2 jar Package
B. Set JSP encoding to UTF-8
C. Add struts2 Filter to Web. xml
D. Add struts.xml to src directory
E. Adding a test action to test whether the STRUTS2 is configured successfully
2. Configure Spring3
A. Copy the jar that the Spring3 depends on (note: Remove the redundant jar and keep the high version)
B. Adding applicationcontext.xml to the SRC directory
C. Writing a simple test case to test if spring is configured successfully
3. Configure Hibernate
A. Copy the jar that Hibernate relies on (again, note to delete duplicate jars, keep the high version), the packages that the JPA depends on, the packages that the C3P0 connection pool depends on
B. Adding a database-driven jar (example MySQL)
C. Add hibernate.cfg.xml (Configure Hibernate database connection, configure C3P0 connection pool)
D. Adding a Log4j.property file
E. in MySQL execution Test.sql, it is only necessary to create a table called T_test, there is only one ID field. Here you only need to test hibernate configuration OK
F. Add an entity field called Test T_test table corresponding to
G. Adding a test class entity to a Hibernate.cfg.xml file
4. Integrating STRUTS2 and Spring
A. Integration solution--STRUTS2 is responsible for the request response process, and spring is responsible for action creation
B. Add Struts2-spring-plugin-2.5.10.1.jar
C. Adding @component to the Testaction class
D. Modify Web. XML, add spring Contextloadlistener, add contextconfiglocation profile parameters, add log4j configuration parameters
E. Modify the Struts2.xml to set the class property of the action to spring's automatically created bean name
5. Integrating Spring with hibernate (C3P0)
A. Integration scenario--spring is responsible for creating sessionfactory, configuring connection pooling, configuring declarative transactions
B. Add Spring-orm-4.3.8.release.jar
C. Connect the database in Hibernate.cfg.xml and configure the data source in Applicationcontext.xml
D. Configuring the Sessionfactory Bean, transaction manager
Eclipse Integration Spring 4 + Struts 2.5 + Hibernate 4.2