Integration of Struts2 and Spring: 1. add jar package (note package conflict), also need to note must be added to the struts2-spring-plugin.jar package 2. add support files (struts. xml and applicationContext. xml) 3. configure web. xml (1) configure the startup parameters required for spring initialization (wildcards can be used to separate multiple files if they are available) <context-param> <param-name> contextConfigLocation </param-name> <param-value> classpath: applicationContext. xml </param-value> </context-param> (2) configure the spring context listener (mainly used to generate a WepApplicationContext object at startup) <listener> <listener-class> or G. springframework. web. context. contextLoaderListener </listener-class> </listener> (3) configure the filter of struts2. develop implementation code for each layer. 5. in applicationContext. when configuring various beans in xml, note that the configuration of action bean is the same as that of other beans. 6. in struts. configure Action in xml. For the rest, you only need to set the class value to the id of the action Bean we configured in spring. Integration of Spring and Hibernate: 1. add corresponding jar packages. 2. add corresponding support files. 3. configure the SessionFactory object of Hibernate in the spring configuration file, and use the core configuration file of Hibernate as its attribute value. You can also choose not to use the core configuration file of hibernate. All the ing information is configured in spring, but this will increase the difficulty of coding, so this method is rarely used. <! -- Configure the sessionFactory object --> <bean id = "sessionFactory" www.2cto.com class = "org. springframework. orm. hibernate3.LocalSessionFactoryBean"> <! -- Import the core configuration file of hibernate --> <property name = "configLocation" value = "classpath: hibernate. cfg. xml "> </property> </bean> 4. when writing a Data Handler class Dao, the DAO directly or indirectly inherits from HibernateDaoSupport. We can use the hibernateTemplate attribute in this class to perform various data operations, this template object will help us complete the non-technical operations. 5. configure our Dao. Note that the sessionFactory attribute needs to be configured during configuration. 6. Configure the OSIV filter to solve the problem that the session has been disabled)