Introduction to Spring Boot Development -- Web services with Restful interface
Preface: content tips of this article
Create a Spring Boot based web project on Idea. When the client browser accesses the web service resources with get, put, post, etc., the server can make correct results. Install Postman software and test your web with Postman.
1, Create a Spring Boot based web project on IDEA
The specific steps ...
Posted by Rianna on Mon, 20 Sep 2021 21:09:19 -0700
SpringBoot learning notes 1: basic content
SpringBoot Basics
SpringBoot overview
SpringBoot: SpringBoot provides a way to quickly use Spring. Based on the idea that convention is better than configuration, developers do not have to switch between configuration and business logic, which greatly improves the development efficiency.
Spring disadvantages
Cumbersome configuration Al ...
Posted by playaz on Mon, 20 Sep 2021 16:17:28 -0700
SpringBoot + Maven parent-child module project
project
Eclipse editor, create a new project student using maven's parent-child module function, which is divided into three modules: student web, student-setting, student-util. Student web is packaged as a war package. As a project, student setting and student util are packaged as jar packages and introduced into student web as depend ...
Posted by FaT3oYCG on Mon, 20 Sep 2021 10:36:11 -0700
Start SpringCloud Alibaba from scratch (84) - Thread pool in SpringBoot
Preface
Recently, I need to use multi-threading, it is very difficult to maintain thread pool by myself. I happen to see an example of springboot integrated thread pool. Here I try and summarize it, record it, and share it with friends I need.
This multithreaded implementation is relatively simple, regardless of transactions. There are the fo ...
Posted by kentlim04 on Mon, 20 Sep 2021 09:15:43 -0700
Degraded configuration of OpenFeign
preface
When we need to call other microservices or third-party interfaces, we may use Dubbo or Spring's own component RestTemplate, but compared with the previous two, I prefer to use Feign, a component of Spring cloud. In my opinion, Feign is more flexible.
OpenFeign basic use
I'm too lazy to write a micro service myself. Here I sear ...
Posted by possiblyB9 on Mon, 20 Sep 2021 06:26:50 -0700
Unified return and exception handling commonly used in Java projects
First create a crud project.
controller calls service and mapper
The following is replaced by simple code
controller
@GetMapping("/getUserById")
public String getUserById(String id){
String userById = userService.getUserById(id);
return userById;
}
service
@Override
public String getUserById(String ...
Posted by savedlema on Sun, 19 Sep 2021 19:33:01 -0700
SpringBoot auto configuration principle
SpringBoot auto configuration principle
This section also analyzes the automatic configuration of SpringBoot from the source code and how to write the configuration file!
1. Review the operating principle
As can be seen from the previous operation principle of SpringBoot, SpringBoot implements automatic configuration through the AutoConfigur ...
Posted by frewuill on Sun, 19 Sep 2021 10:57:52 -0700
Spring framework learning record 6 integrating Junit and Web Environment
Integrated Junit:
Example:
(1) Import dependent
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifac ...
Posted by vlcinsky on Sun, 19 Sep 2021 04:21:26 -0700
SpringBoot auto configuration principle
1. springboot features
1.1 dependency management
The parent project does dependency management. The in the parent project collects almost all the jar packages required by the Spring framework for web development.
Dependency management
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId> ...
Posted by kat89 on Sat, 18 Sep 2021 12:46:55 -0700
Practice of spring boot custom initialization Bean+HashMap optimization strategy mode
Policy pattern: it defines algorithm families and encapsulates them separately so that they can be replaced with each other. This pattern makes the changes of the algorithm independent of the customers using the algorithm.
The traditional policy mode is generally to create a public interface, define a public method, then create an entity class ...
Posted by leoo24 on Sat, 18 Sep 2021 06:27:20 -0700