Spring has had a glorious time. It keeps pace with the times and leads the trend of Java programming for at least 10 years. Now, with the birth of Spring Boot, we no longer have to be constrained by Spring's cumbersome configuration. Spring Boot is an excellent framework for current back-end development. It is particularly prominent in today's numerous technologies.
Now that SpringBoot has entered version 2.0, what we bring to you today is the actual combat of SpringBoot after SpringBoot2.0. From entry to actual project combat with microservice SpringBoot, this note is positioned at entry, advanced, and actual combat. Therefore, we will take care of beginners who have a certain programming experience and a certain understanding of programming, as well as relatively senior developers.
This note has a total of fifteen parts, including the last two actual projects:
- Enter the Spring Boot world
- Prepare the development environment
- Use development tools
- Spring Boo basics
- Layered development of web applications
- Responsive programming
- Spring Boot advanced
- Use ORM to operate SQL database
- Interface architecture style-RESTul
- Integrated security framework to achieve security authentication and authorization
- Using Redis to achieve high concurrency in Spring Boot
- Use RabbitMQ to realize data exchange between systems
- Use NoSQL database to realize search engine
- Develop an enterprise-level general back-end system
- Realize an e-commerce mall similar to Jingdong
In order not to affect your reading experience, I put the free method of obtaining this note at the end of the article! ! !
Chapter 1 Entering the Spring Boot World
Meet Spring Boot
Suggestions for learning Spring Boot
Chapter 2 Preparing the Development Environment
Build the environment
- Install Java development environment JDK
- Configure JDK environment variables
Familiar with Maven
- Install and configure Maven
- Know the pom.xml file
- How Maven works
- Configure domestic warehouse
Chapter 3 Using Development Tools
Install development tools IDEA and plug-ins
- Install IDEA
- Configure IDEA's Maven environment
- Install Spring Assistant plugin
- Install the plugin Lombok
Example 1: Output "Hello World" with Spring Boot
- Build a Spring Boot project
- Write the controller to realize the output function
- Run the program in IDEA
- Packaged into executable JAR package
Develop Spring Boot application in Eclipse
- Install Eclipse
- Install Spring Tools 4 plugin
- Configure Eclipse's Maven environment
- Create Spring Boot project
Learn about Spring's official development tool STS
Essential IDEA practical skills
- Smart prompt code
- Auto prompt parameter
- Implement automatic escaping
- Custom high reuse code block
- Set annotation information
- Super "Alt+Enter" shortcut
- Use global configuration
- Automatically generate statements
Compare IDEA and Eclipse
Chapter 4 Spring Boot Basics
Learn about Spring Boot
Common annotations of Spring Boot
Use configuration files
- Example 3: Demonstrate how to use the application.yml file
- Example 4: Demonstrate how to use the application.properties file
- Example 5: Configure multiple environments with application.ym and application.properties
Learn about Spring Boot's Starter
Chapter 5 Layered Development of Web Applications
Application layered development model-MVC
Using the view circle technology Thymeleaf
- Meet Thymeleaf
- Basic grammar
- Processing loop traversal
- Process common code blocks
- Handling paging
- Verify and prompt error messages
- Example 6: Write Thymeleaf view to display data
Use the controller
- Common notes
- Map URL to method
- Processing HTTP request method
- Processing content type
- Use of parameters in methods
Understanding the model
Example 7: Web applications that implement the MVC pattern
- Add dependency
- Create a solid model
- Create controller
- Create a view for presentation
verify the data
- Know the built-in validator Hibernate-validator
- Custom verification function
- Example 8: Validate form data and implement custom validation of data
Chapter 6 Reactive Programming
Understanding reactive programming
Example 9: Implement Hello World with annotation development
- Configure WebFlux dependencies
- Write the controller
Example 10: Use annotation development to realize data addition, deletion, modification and query
- Create entity class
- Write the controller
- Test API function
Example 11: Developing WebFlux with responsiveness
- Write Handler
- Write router class Router
Example 12: Use the WebFlux mode to operate the MongoDB database to realize data addition, deletion, modification and query functions
- Add dependency
- Create entity class
- Write interface
- Write API to add, delete, modify and query data
Chapter 7 Spring Boo Advanced
Aspect Oriented Programming AOP
- Meet Spring AOP
- Example 13: Use AOP to manage logs
Know the loC container and Servlet container
- Know the container
- Example 14: Manage Beans with IoC
- Example 15: Servlet processing request
Filters and listeners
Know the filter
- Example 16: implement filters
- Know the listener
- Example 17: implement a listener
Automatic configuration
- Custom entry class
- Principle of automatic configuration
- Example 18: Custom Starter
Meta annotation
- Understanding meta annotations
- Example 19: Custom annotation
Exception handling
- Understanding exception handling
- Use controller notification
- Example 20: Custom error handling controller
- Example 21: Custom business exception class
unit test
- Understand unit testing
- Spring Boot test library
- Quickly create test units
- Example 22: Unit test of the Controller layer
- Example 23: Unit test of Service layer
- Example 24: Unit test of the Reitory layer
Chapter 8 Operating SQL Database with ORM
Know Java's database connection template JDBCTemplate
JPA-Java Persistence API
- Meet Spring
- Data
- Know PA
- Use JPA
- Introduction to JPA annotations and attributes
- Example 26: Use JPA to build an entity data table
Know the JPA interface
- JPA interface JpaReitory
- Paging sort interface PagingAndSortingReitory
- Data manipulation interface CrudReitory
- Paging interface Pageable and Page
- Sort
JPA query method
Convention method name
- JPQL
- Native SQL
- Specifications
- ExampleMatcher
- Predicate QueryDSL
- NamedQuery
Example 27: Use JPA to develop article management module
Implement auto-fill fields
Master relational mapping development
Know MyBatis-Java data persistence layer framework
Example 31: Use MyBatis to add, delete, modify, query and paging data
Compare JPA and MyBatis
Chapter 9 Interface Architecture Style-RESTfuI
REST-the communication method between front and back office
Design a unified RESTful style data interface
- version control
- Filter information
- Determine the HTTP method
- Determine the return status of HTTP
- Define a unified return format
Example 32: Provide a unified API for APP, PC, and H5 web pages
- Enumeration class that implements response
- Realize the returned object entity
- Package return result
- Unified exception handling
- Write a test controller
- Realize data addition, deletion, modification and query controller
- Test Data
Example 33: Use Swagger to implement interface documents
- Get to know RestTemplate
- Example 34: Send GET request with RestTemplate
- Example 35: Send T request with RestTemplate
- Send PUT and DELETE requests with RestTemplate
Use RestTemplate to initiate a request
Chapter 10 Integrated security framework to achieve security authentication and authorization
Spring Security-Spring's security framework
Configure Spring Security
- Inherit WebSecurityConfigure-Adapter
- Configure custom policies
- Configure encryption method
- Custom encryption rules
- Configure a multi-user system
- Several ways to get the information of the currently logged in user
Example 36: Use Spring Security to implement background login and permission authentication functions
- Introduce dependencies
- Create a page with open permissions
- Create a page that requires permission verification
- Configure Spring Security
- Create a login page
- Test permissions
Access control method
- Spring EL permission expression
- Control URL permissions through expressions
- Control method permissions through expressions
- Example 37: Using JSR-250 annotations
- Example 38: Implement RBAC permission model
Meet JWT
Example 39: Using JWT technology to add authentication and authorization protection to Spring Boot's API
Shiro-Apache General Security Framework
Example 40: Use Shiro to realize the dynamic authority function of the management background
Compare KSpring Security and Shiro
Chapter 11 Using Redis to Achieve High Concurrency in Spring Boot
Meet Spring Cache
Meet Redis
Redis data types
Use RedisTemplate to operate 5 data types of Redis
Example 47: Use Redis and MyBatis to add, delete, modify, and query cache data
Example 48: Use Redis and JPA to cache articles and clicks
Example 49: Implement distributed Session
Chapter 12 Use RabbitMQ to Realize Data Exchange Between Systems
Meet RabbitMQ
Basic concepts of RabbitMQ
Six working modes of RabbitMQ
Know the AmqpTemplate interface
Integrate RabbitMQ in Spring Boot
Implement 4 sending/receiving modes of RabbitMQ in Spring Boot
Example 54: Implement the message queue delay function
Chapter 13 Using NoSQL Database to Implement Search Engine
Elasticsearch-search application server
Example 55: Use ELK to manage Spring Boot application logs
Example 56: Realize the functions of adding, deleting, modifying, and querying documents in Spring Boot
Elasticsearch query
Example 57: Implement a product search engine
Solr-search application server
Example 58: Realize data addition, deletion, modification and query in Solr
Compare Elasticsearch and Solr
Chapter 14 Example 59: Develop an enterprise-level general back-end system
Realize the mapping relationship between entities with JPA
- Create user entity
- Create role entity
- Create authority entity
Implement dynamic authorization (RBAC) function with Spring Security
- Realize management (add, delete, modify and query) administrator role function
- Realize management authority function
- Realize the function of management administrator
- Configure security class
- Realize RBAC permission control function
Monitor Spring Boot applications
- Integrate Actuator in Spring Boot
- Integrate Spring Boot admin application monitoring in Spring Boot
- Integrate Drid connection pool monitoring in Spring Boot
Chapter 15 Example 60: Realizing an e-commerce mall similar to Jingdong
Implement Member System with Spring Security
- Implement member entities
- Implement member interface
- Realize the multi-method registration function of user name, email and mobile phone
- Realize the use of MQ to send member registration verification emails
- Realize the multi-way login function of user name, email address and mobile phone number
Integrated membership system (Web and APP multi-terminal multi-method registration and login) + back-end system
Implement shopping system
- Design data sheet
- Realize product display function
- Implement shopping cart function
- Use Redis to realize shopping cart data persistence
Using Redis to implement a distributed spike system
- Realize the panic buying function and solve the problem of concurrent oversold
- Cache pages and limit current
Use RabbitMQ to realize the cancellation function of the order expired
Realize settlement and payment functions
- Realize the function of generating orders for settlement
- Integrated payment
Free access method: one-click three consecutive this article + follow me, scan the code to get!