SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

Introduction to SSM:

The SSM (Spring+SpringMVC+MyBatis) framework set is integrated by three open source frameworks: Spring, SpringMVC, and MyBatis, and is often used as a framework for web projects with simpler data sources.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Fundamental contents:

  • Among them, spring is a lightweight inversion of control (IoC) and aspect-oriented (AOP) container framework.
  • Spring MVC separates the roles of controllers, model objects, dispatchers, and handler objects. This separation makes them easier to customize.
  • MyBatis is an excellent persistence layer framework that supports ordinary SQL queries, stored procedures and advanced mapping.
  • The page sends a request to the controller, the controller calls the business layer processing logic, the logic layer sends a request to the persistence layer, the persistence layer interacts with the database, and then returns the result to the business layer, the business layer sends the processing logic to the controller, and the controller then Call the view to display the data.

Let me share with you this sincere work, a summary of 15 years of development experience by first-line technical experts. Recommended by 4 technical experts from well-known companies such as Huawei and Alibaba: Spring+Spring MVC+MyBatis integrated development document

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

Friends who need this information can directly forward it and follow it and get it by private message (learning)

Catalog display:

The first Spring core framework

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 1 Overview of Sprinz

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 2 A Probe into Spring IoC Container

2.1Spring IoC container and related concepts

In learning and using Spring, you will inevitably encounter some proper nouns and terms. Some of these terms and terms have similar meanings, and some are compared with each other. Developers often confuse these concepts. Certain concepts and technologies are not strongly related to each other, but rather focus on design and architecture. These concepts are as follows:

  1. What are the concepts of components, frameworks and containers in system development? What are the connections between them?
  2. What is the definition of JavaBean, EJB and POJO in the Java field? What is the difference between the three?
  3. Are Spring's Inversion of Control (IoC) and Dependency Injection (DI) the same concept? If not, what is the difference?
  4. What is the EJB that is always compared with Spring? Is it comparable and replaceable with Spring? Which is better or worse?
  5. Based on the introduction of these concepts, this section will clarify the differences and connections between them to help readers understand and learn Spring.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 3 Web project environment construction and project creation

3.1 Environment and preparation

The development of Java and Java Web can be carried out under Windows or Linux. For different platforms, install the corresponding JDK and IDE for each platform. This book is based on the Windows64-bit system, using the JDK8 version, developed on the Eclipse integrated development platform, the database is MySQL, the Web server uses Tomcat, and Maven is used for dependency package management and project management. The specific configuration list is as follows:

  1. Operating system: Windows 8, 64-bit;
  2. Java version: JDK 8u65, 64-bit;
  3. -Eclipse:2019-06(4.12.0);
  4. - Tomcat:9.0.12;
  5. MySQL:8.0.13;
  6. - Maven:3.5.4。

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 4 Advanced Spring IoC Container

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 5 Configuration Based on Notes and Code

5.1 Java annotations

Annotation is a concept introduced in Java SE 5.0. Like Class and Interface, it is also a type. The definition specification of the annotation itself is JSR-175. The role of this specification is to provide annotation library support. JDK5 contains the defined interface and provides basic annotations such as @Override. On the basis of JSR-175, JCP defines a series of annotation usage standards, including Java platform public annotations (JSR-250) and dependency injection standards (JSR-330).

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 6 Spring Test Method

Unit testing and integration testing are generally tests that developers need to perform. Spring's test module spring-test provides good support for both types of tests. For unit testing, based on the basic testing framework (JUnit, TestNG) and Mock framework, use the advanced mock objects and convenient test sharing methods provided by Spring to achieve isolated testing of a single class in a Spring application. For integration testing, Spring expands the basic testing framework and provides an annotation-based testing framework. The container initialization, container caching, environment selection, database transaction management and other functions can be completed through configuration in the test class, which greatly simplifies the testing work , Improve the test efficiency.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Part 2 Spring MVC Framework

 

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 7 Overview of Spring Web MVC

The combination of Spring and Structs was once a popular combination of Java Web development frameworks. Spring was used as a management container for beans and dependencies, and Structs was responsible for the front-end processing and display. Spring MVC implements an MVC framework with a central controller (DispatcherServlet) as the core on the Spring core framework, seamlessly integrating with the Spring core container.

Like the Spring core container, Spring MVC also supports annotation-based development, and can even achieve zero XML configuration development in Web projects. This chapter first briefly introduces the web-related knowledge required to learn Spring MVc, and then elaborates on the technical details and annotations of Spring MVC.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 8 Data Type Conversion, Verification and Exception Handling

The attribute value of the string type is directly injected in the XML Bean configuration, and the attribute value of the object type such as date can also be injected through the string type value in the Bean configuration. The Spring container can automatically convert the attribute value of the string type into the attribute value of the object type. The framework uses property editor (PropertyEditor) and converter service (ConversionService) to realize.

In the Spring framework, a validator can be used to verify the validity of the attribute value. The verification method integrates the support of the JavaBean Validator standard validation, and you can also define Spring's own validator. In the parameters of the request mapping method of the Controller class of the Spring MVC project, the annotation @Validated is used to enable the validity check of the front-end parameter matching. Data validity verification and exception handling can be achieved both locally and globally.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 9 Spring MVC Advanced

Projects based on Spring+Spring MVC can maintain only one container, or use parent-child hierarchical containers, separate core containers and web containers. The Spring MVC framework uses DispatcherServlet to intercept and dispatch requests, but for static resource files such as pictures and styles, there is generally no need to intercept them, and they can be released directly.

The central controller intercepts the request and calls and processes it and returns the model view page or returns a response in a data format such as JSON. JSON is used as a data exchange format for REST-style services and is mostly used in a front-end and back-end separation architecture. Spring MVC provides good support for REST. In addition, Spring MVC provides a convenient and unified processing method for file upload, and provides the function of obtaining internationalized messages at the container level.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 10 Spring MVC Testing Framework

The Spring MVC test framework provides a simple way to test Web applications. It does not need to start the Web server. Based on the unit test framework, it can simulate the sending of browser requests and return a simulated HTTP response. The MVC test framework also provides a lot of quick verification methods based on the unit test framework, which can verify the status and content of the request and response in detail. The SpringMVC testing framework supports independent testing and integration testing, and provides good support for traditional view models and JSON and XML content types of requests and responses. In addition, you can also use the test framework to test the file upload speed.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

The content of this document contains almost all the content of SSM. Friends who need to obtain this information can directly forward it + follow the private message (learning) to get all the content of the above document for free!

Chapter 3 Data Technology

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 11 Database and Java Data Access Technology

Database development is an indispensable part of application development. Relational database is the most widely used database type. Oracle and MySQL are the "leaders" of commercial and open source relational databases respectively, and both are currently Oracle products. Java officially defines the standard unified interface JDBC for accessing relational databases. Database vendors provide the drive and implementation of database access operations based on the standard interface. In order to save the overhead of database connection establishment and release, database connection pool technology and third-party packages have emerged, which can greatly improve the performance of application and database interaction.

ORM technology has brought good news to Java developers with object-oriented thinking. You only need to process Java objects to automatically complete database operations. Hibernate, MyBatis, and Eclipse Link are all very good Java ORM frameworks, but their calling methods are completely different. Therefore, Java officially formulated the standard for mapping operations between objects and data tables: JPA (Java Persistence Application Interface). Each ORM framework provides implementation based on the JPA interface. Developers use a unified interface to implement the conversion of Java objects and database tables.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 12 Getting Started with MyBatis

Hibernate and MyBatis are the most commonly used ORM frameworks in Java. Both have their own strengths and can also be used in the same project. MyBatis is a lightweight semi-automated framework. It does not force to rely on other third-party packages and can be developed by importing the project. This chapter starts with a simple example, and gradually expands the learning of MyBatis's core interfaces, classes, global configuration, object and table mapping.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 13 Advanced MyBatis

MyBatis is a lightweight ORM framework with simple internal operation mechanism. In addition to some basic functions, MyBatis also provides the development and configuration of advanced functions such as type processors, object factories, and plug-ins. Dynamic SQL can be used to configure SQL statements for mapping methods more flexibly.

To speed up data access, MyBatis can cache query statements and query results at two levels, combined with log output, to verify the cache effect. In addition, the use of annotation mapping SQL statements in the interface method can replace the mapping configuration of XML, and MyBatis also provides SQL constructor tool classes for generating complex SQL statements.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 14 Spring Data Access and Transaction Management

The Spring framework encapsulates JDBC and provides a template class (JdbcTemplate) for JDBC operations to simplify database operations. JdbcTemplate is constructed using DriverManagerDataSource type data source objects, but this type of data source does not implement data connection pooling. The connection pool function can be implemented by importing a third-party connection pool library (such as DBCP or C3PO). Because Spring has a great relationship with Hibernate, the spring-orm module provides integration with Hibernate ORM framework by default, and this module also includes support for standard JPA specification interfaces.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 4 SSM Integrated Development

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 5 Advanced Development Technology

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 15 Overview of SSM Integration

In the SSM integration framework, Spring is used as a container for back-end components, and Spring MVC provides a central controller and management front-end components. In small projects, the two can also be combined into one. As a bridge between MyBatis and Spring, MyBatis-Spring realizes the seamless integration of the two. Spring manages the MyBatis session factory object. In addition to using the MapperFactoryBean class to configure the mapping interface proxy Bean, it can also scan the mapper interface automatically as a component scan. In addition to business functions, SSM integration projects also need to consider the integration of basic functions such as exceptions and logs.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

Chapter 16 SSM Integration Examples

This chapter takes a report project as an example (the project name is Daport, Data AnalysisReport), starting from the requirements of the project, to the entire process of system analysis, system design, system framework construction and even code development. The project uses a quasi front-end and back-end separation architecture. The front-end uses the ExtJS framework to display the UI, the back-end uses the SSM framework to provide services, and the JSP page is used to manage Session and permissions. Due to limited space, the requirements, analysis and design of the examples in this chapter are simplified and introduced.

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

System architecture diagram:

SSM actual combat document blown up by 4 well-known first-line technical experts such as Huawei and Ali

 

In the architecture shown in the figure, the front and back ends are based on the MVC architecture, and both ends are independently developed and run on different ports, integrated through index.jsp.

The content of this document contains almost all the content of SSM. Friends who need to obtain this information can directly forward it + follow the private message (learning) to get all the content of the above document for free!

Guess you like

Origin blog.csdn.net/Java555222/article/details/108939416