Spring Boot 2 practice: customize the startup and operation logic
1. Preface
I don't know if you have received this kind of demand, and immediately implement some logic after the project is started. For example, cache preheating, or broadcasting after online, etc. Maybe not now but in the future. Think about your possible operation, write an interface and go online. Can I adjust it once? NO! NO! NO! This kin ...
Posted by russ8 on Sun, 03 Nov 2019 05:11:57 +0100
Global exception handling of SpringBoot (full version)
Article directory
1. Project structure
2. exceptionCodeMsg.properties configuration file
3. ExceptionCodeMsgUtil configuration file tool class
4. ExceptionCodeMsg error code / information entity
5. ResponseEntity return entity
6. IServiceException custom exception
7. GloabExceptionHandler global exce ...
Posted by Mordred on Fri, 25 Oct 2019 22:01:07 +0200
Integrated HttpClient of SpringBoot
Table of Contents
1.maven add dependency
2. Add profile information
3. Create HttpClient entity class association configuration
4. Create connection thread processing class
5. Create request return result class
6. Create specific request class
1.maven add dependency
pom.xml: here, we add the ...
Posted by petitduc on Fri, 25 Oct 2019 21:08:57 +0200
Using JAXB to transform XML and JavaBean (supporting generics)
I saw that someone else had a medal of 1024, and I specially left one on October 24 this year to see if I could get it.
In the daily development, it may involve the mutual call between interfaces. Although under the promotion of the concept of microservice, many companies use the lightweight JSON fo ...
Posted by manohoo on Thu, 24 Oct 2019 12:37:06 +0200
[Lombok, Java development tool] common annotation demonstration
In the past, when coding the object model, we need to write a lot of get/set and different constructors. Lombok provides us with a very good plug-in form.In most projects, it's enough to use the following set of annotations. If you need to see more options, please refer to: Portal
@Getter
@Setter
@ToString
@RequiredArgsConstructor Constructo ...
Posted by mothermugger on Wed, 16 Oct 2019 16:55:29 +0200
lombok goes deep into practice
Official website video
Official address: https://projectlombok.org
The home video of the official website demonstrates how to use Lombok in eclipse.
Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.
Never write another getter or equals method again, with one annotation your class ...
Posted by Johns3n on Thu, 10 Oct 2019 14:57:24 +0200
Simple Practice of Disruptor Framework
Simple Practice of Disruptor Framework
Basic knowledge
Architecture diagram
Core concept
Simple practice
https://github.com/LMAX-Exchange/disruptor/wiki/Introduction
https://github.com/LMAX-Exchange/disruptor/wiki/Getting-Started
http://lmax-exchange.github.io/disruptor/files/Disruptor-1.0.pdf
...
Posted by finkrattaz on Fri, 04 Oct 2019 07:32:53 +0200
7. Short Message Verification Code Login Based on Spring Security
Based on the analysis of the process of user login in SpringSecurity, we need to customize the following categories to implement the phone number plus verification code.
SmsCodeAuthenticationFilter
package com.liaoxiang.smsCodeLogin;
import org.springframework.security.authentication.AuthenticationSer ...
Posted by Danicek on Tue, 01 Oct 2019 17:37:40 +0200
Introduction and Use of Hibernate Validator
Preface
Recently, when developing the function of a module, it contains a lot of steps of blanking and validating the request parameters, and there are a lot of repeated judgments. Validation affects the beauty of the code and then decides to optimize this part of the code. SpringBoot comes with its own parameter validation box, Hibernate Valid ...
Posted by zak on Tue, 01 Oct 2019 05:12:34 +0200
Spring Boot 2.x Basic Tutorial: Building RESTful API s and Unit Testing
First, review and elaborate on quick get start The @Controller, @RestController, @RequestMapping annotations used in the.If you are unfamiliar with Spring MVC and have not tried the Quick Start case, it is recommended that you take a look first quick get start Content.
@Controller: Decorates the class to create an object that handles http req ...
Posted by Crowly on Sat, 28 Sep 2019 18:05:59 +0200