Three basic framework Integration Methods: Struts2, Hibernate, and Sring (I)

Source: Internet
Author: User

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.