spring4.x + Spring MVC + MYBATIS3 0 Configuration Application Development Framework (1)-? Basic introduction _spring Integration

Source: Internet
Author: User

spring4.x + Spring MVC + MYBATIS3 0 Configuration Application Development Framework (1)-Basic introduction

Two years ago has been doing the background of pure Java development, rarely involved in web development this piece, recently changed a pure Internet company, need to do a Web backend management system, before all the project with XML configuration, Contacted the company's spring4.x 0 configuration project, feel very feeling, not only simple configuration, and clear, so, here the content of learning to record, to deepen the impression of this piece of technology, and prepare to do a simple tutorial, if the other people to share the time can also be used directly.

First of all, tell me why we should do framing. Now open source software, are some of the very idea of a group of technology Daniel used in his spare time to come out, and just started to do the framework, is to solve their work faced with some problems. For example, to solve the JavaBean dependency management, the emergence of spring, to solve the problem of database access operation was born Hibernate,mybatis, the solution of Business logic Code and View Code separation, the birth of the Struts,springmvc ... You may ask, why not come directly to a framework that contains all the solutions. I personally think there are several reasons for this:

First, the framework solves only one business area problem, and the founders of the framework are limited in their efforts to do everything.

Second, the code maintenance, refactoring, upgrade time is actually more time-consuming than the development;

Third, the all-inclusive framework is better than solving a certain area framework, software development faced with changes in demand and the scene is enough, a all-inclusive framework for a variety of reasons, will limit its development, such as spring-side framework. Because if it's already integrated with other third-party frameworks, there are a lot of changes and adaptations involved if a user needs to modify a section.

Four, because these software audience small, encounter some special scene, if want to integrate not commonly used third party library and content, learning cost, stability, security and other factors become more important. Although it has already integrated many libraries, it does not look like the cumbersome configuration is very management, in fact, if you need to do some adaptation and modification of the work, this large integration of the package is often very high technical requirements, not the average person can change, and not 1:30 will be able to change out.

Therefore, with the existing mature, stable library to build a framework of their own, the technical requirements, learning costs of a lower demand.

Let's take a look at the diagram of these frameworks:

Let's talk about the implementation principle of the 0 configuration: Servlet3.0 specification, support to Web.xml related configuration also hard coded into the code [Servlet,filter,listener, etc.], and the Javax.servlet.ServletContainerInitializer implementation class is responsible for loading at the start of the container, Spring provides an implementation class Springservletcontainerinitializer (in the Spring-web package Org.springframework.web directory), This class invokes the Onstartup method of all Org.springframework.web.WebApplicationInitializer implementation classes, registering the relevant components with the server, and our Webapplicationinitializer inherits from Abst Ractannotationconfigdispatcherservletinitializer, and Abstractannotationconfigdispatcherservletinitializer realized the Onstartup method of Org.springframework.web.WebApplicationInitializer, so Webapplicationinitializer is the key to the whole project, and our entire project is launched through it. This webapplicationinitializer is described in detail in the code of our example.

Because of its length, I have divided it into the following sections, which are explained individually:

(i) Basic introduction
(ii) Infrastructure framework
(iii) Implementation of the most basic login processing
(iv) Task scheduling management
(v) Redis cache configuration
(vi) Security framework Integration

(vii) GIT version source code download

Due to the relationship between time, it is impossible to write all finished, so will be updated.

Hint: Want to learn the content of spring 0 configuration, it is best to download the source code to run, and then write it yourself, deepen the understanding and understanding of the framework.




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.