SSM Framework spring+springmvc+mybatis--Detailed Integration tutorial

Source: Internet
Author: User
Tags log4j

Summary: Spring MVC is a successor to Springframework and has been integrated into spring Web flow. Spring MVC separates the controller, the model pair?...

1. Basic Concepts

1.1. Spring

Spring is an open source framework, and spring is a lightweight Java development framework that emerged in 2003 by Rod Johnson in his book expert one-on-one development and Some of the concepts and prototypes elaborated in design are derived. It is created to address the complexities of enterprise application development. Spring uses basic JavaBean to accomplish things that were previously only possible by EJBS. However, the use of spring is not limited to server-side development. From the standpoint of simplicity, testability, and loose coupling, any Java application can benefit from spring. In short, spring is a lightweight control inversion (IoC) and aspect-oriented (AOP) container framework.

1.2, SPRINGMVC

Spring MVC is a follow-on product of springframework and has been integrated into spring Web flow. Spring MVC separates the roles of controllers, model objects, dispatchers, and handler objects, and this separation makes them easier to customize.

1.3, MyBatis

MyBatis is an open source project for Apache Ibatis, which was migrated to Google code by the Apache Software Foundation in 2010 and renamed MyBatis. MyBatis is a Java-based persistence layer framework. The persistence layer framework provided by Ibatis includes SQL maps and Data Access Objects (DAO) MyBatis eliminates the manual setting of almost all JDBC code and parameters and the retrieval of result sets. MyBatis uses simple XML or annotations for configuration and raw mapping, mapping interfaces and Java POJOs (Plain old Java Objects, ordinary Java objects) to records in a database.

2. Construction of development environment

Technology selection (only part of the technology is listed)

1, back-end

Service Framework: Dubbo, Zookeeper, rest services

Cache: Redis, Ehcache

Message middleware: ActiveMQ

Load balancing: Nginx

Distributed files: Fastdfs

Database connection pool: Alibaba Druid 1.0

Core Framework: Spring framework

Security framework: Apache Shiro 1.2

View Frame: Spring MVC 4.0

Server-side validation: Hibernate Validator 5.1

Layout frame: Sitemesh 2.4

Workflow Engine: Activiti 5.15

Task Scheduler: Quartz 1.8.5

Persistence Layer Framework: MyBatis 3.2

Log management: slf4j 1.7, log4j

Tool classes: Apache Commons, Jackson 2.2, Xstream 1.4, dozer 5.3, POI

2. Front-end

JS Frame: JQuery 1.9.

CSS Framework: Bootstrap 4 Metronic

Client-side validation: JQuery Validation Plugin.

Rich Text: Ckecitor

File Management: Ckfinder

Dynamic tab: Jerichotab

Data table: Jqgrid

dialog box: JQuery jbox

Tree structure controls: JQuery Ztree

Other components: Bootstrap 4 metronic

3. Support

Server middleware: Tomcat 6, 7, Jboss 7, WebLogic 10, WebSphere 8

Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source switching and database read and write separation: Oracle, SQL Server, H2, etc.

Support development environment: Eclipse, MyEclipse, Ras, idea, etc.

4. SSM Integration

The following is mainly about the integration of the three frameworks, as for the construction of the environment and the creation of projects, see the above blog post. I've divided 2 profiles for this integration, The Spring-mybatis.xml, which contains the spring and MyBatis profiles, and a configuration file for Spring-mvc, plus 2 resource files: Jdbc.propertis and log4j.properties. The complete directory structure is as follows (finally, the source code, not recommended to use the source directly, because this tutorial already has all the codes):

The use of frames is a newer version:

Spring 4.0.2 RELEASE

Spring MVC 4.0.2 RELEASE

MyBatis 3.2.6

Classic introduction and source code structure please refer to the direct request Exchange sharing technology: 2670716182

SSM Framework spring+springmvc+mybatis--Detailed Integration tutorial

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.