spring boot2.x back end parameter verification + unified exception handling + back end custom global unified interface return response data format

1, Foreword This blog mainly introduces the following aspects: Use Validator to check parameters conveniently and quickly; Specification of completing exception operation through global exception handling; Complete the specification of response data through unified data response; Through user-defined annotation, filter whether the returned r ...

Posted by elementaluk on Sat, 07 May 2022 23:46:54 +0300

centos u disk installation and LNMP

1. Preliminary preparation: Download centeos 7.5: https://mirrors.aliyun.com/centos-vault/7.5.1804/isos/x86_64/ Download floppy disk pass, the registration code is Baidu. download putty, winscp 2. Operation steps: u disk production: Open UltraISO tool File -> Open Select your ISO file. Startup item Select to write the hard disk image ...

Posted by AliceG on Sat, 07 May 2022 16:36:06 +0300

SpringBoot officially supports the task scheduling framework, and it is also very delicious to be lightweight!

Earlier we talked about a distributed task scheduling framework PowerJob, which can perform task scheduling in a visual way. But sometimes we just need a lightweight task scheduling function, and it is a bit heavy for PowerJob to build a scheduling center. At this time, Quartz, the task scheduling framework officially supported by SpringBoot, c ...

Posted by dpiland on Sat, 07 May 2022 07:51:28 +0300

xml way to customize the implementation of the Ioc container

@[TOC] xml way to customize the implementation of the Ioc container Use xml to implement a custom simple Ioc container foreword In the usual development process, we all use Spring for development. The Ioc container at the core of Spring helps us to create objects. This process is called inversion of control, also called Ioc.When an object is in ...

Posted by roydukkey on Sat, 07 May 2022 07:32:39 +0300

Docker installs Redis, and Spring Boot uses Redis to solve the type conversion exceptions in Redis

Dock installs Redis (if installed, please skip this step) 1. Pull Redis image (latest version by default) docker pull redis If the download is slow, it is recommended to configure alicloud image View alicloud image: alicloud official website -- > products -- > search container image service -- > management console ‚Äč Mirror accelerator ...

Posted by asuperstar103 on Fri, 06 May 2022 23:50:35 +0300

Create a mybatis custom persistence framework [implement simple single table crud]

Custom persistence framework mybatis preface JDBC operation database and Mybatis operation database. Why use the Mybatis framework instead of the native JDBC operation database?With these questions, let's take a look at the native JDBC data operation steps! JDBC database operation steps 1 load drive 2 create connection 3 compiling sql statemen ...

Posted by lady1dc on Fri, 06 May 2022 23:17:22 +0300

[Spring] Execution principle of transaction

rollback of transaction If the acquired transaction attribute is not empty and the thrown exception is of type RuntimeException or Error, call the rollback method in the transaction manager to roll back If the transaction property is empty or the exception thrown is not RuntimeException or Error, the transaction will continue to be committed ...

Posted by (RL)Ian on Fri, 06 May 2022 07:27:05 +0300

Java virtual machine shutdown hook (Shutdown hook)

Source click study Check What is a Shutdown hook Shutdown hook is a hook closed by Jvm. It is implemented by the Runtime#addShutdownHook(Thread hook) method. According to the api annotation, it can be seen that it is a series of thread objects that have been initialized but not yet executed. We can register a hook with Jvm to realize the functi ...

Posted by sprinkles on Thu, 05 May 2022 19:47:21 +0300

Java classic written test question: can you write a simple implementation of ArrayList?

Interviewer Q1: can you write a simple implementation of ArrayList? We all know that ArrayList is implemented based on array. If you are asked to implement the add(), remove(), get() methods in ArrayList of JDK source code, do you know how to implement them? In this section, instead of looking at the source code, let's think about how to simpl ...

Posted by lush_pierre on Wed, 04 May 2022 08:28:04 +0300

Summary of JAVACC use: Syntax Advanced - Recursive Steps of Aggregate Functions

Aggregate functions I remember that I should have learned the concepts of sets and related operations on sets in junior high school. Now I will review the following summary. 1. The meaning of the set: some specified objects are set together to become a set, and each object is called an element. 2. Three characteristics of the elements in the ...

Posted by sirish on Tue, 03 May 2022 21:06:58 +0300