Gradually, you have learned three basic frameworks, but each of them seems to have a disruptive experience. The question is, how should we use these three frameworks? The answer is of course used together. Next, let's talk about the organic integration of the three frameworks: first, we need to select the versions of the three frameworks we are using, not all of which are the same integration methods, I mainly filtered out the stable versions that are commonly used in the Set: 1. hibernate-distribution-3.6.10.Final2.spring-framework-2.5.6-with-dependencies3.struts-2.3.4.1-all is then the integration of the Order of the problem, the three frameworks have their respective use, then we should first integrate who? It is best to use Spring first, Because Spring is a framework for managing the first two frameworks. Its use can greatly reduce the difficulty and steps of using the first two frameworks. The second integration is Hibernate. It is responsible for the persistent layer of data and will naturally be used in the middle, the final integration is Struts. Open the IDE tool first, the blogger uses the <Myeclipse 9> database <Mysql 5.5> database management tool <Navicat>. The first step is to build a project that wants to integrate the framework: there should be the following package and structure:
We started to import all the necessary Jar packages for the three frameworks into the lib folder, saving BuildPath. At this time, we are about to start configuration import. To start Spring under the web, we need to modify the web. xml configuration file, in which the field is as follows: <! -- Configure the context parameter and specify the location of the spring configuration file --> <context-param> <param-name> contextConfigLocation </param-name> <param-value> classpath: config/spring. xml </param-value> </context-param> <! -- Spring starts with a listener in a web environment --> <listener-class> org. springframework. web. context. ContextLoaderListener </listener-class> </listener>