SpringBoot custom exception to gracefully resolve errors in business logic

outline Are you worried about the anomalies in business logic, often reporting errors in the background, but the front-end can not prompt the wrong content, resulting in poor user experience? For example, if the order fails, the front end can only prompt the order fails, but do not know why the failure is due to insufficient inventory, insuffic ...

Posted by mrdeadman on Thu, 10 Oct 2019 14:04:56 -0700

How to use Oauth2 to complete password policy authorization in SpringBook?

How does Oauth2 use password policy to complete authorization? I. Importing Relevant Dependencies POM file <!-- oauth2 Dependent dependence --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> &l ...

Posted by volatileboy on Thu, 03 Oct 2019 14:46:39 -0700

springboot-poi -- Encapsulating Annotated Import and Export

This demo is based on poi encapsulated object annotation import and export, the project framework is spring boot project! Simply explain the knowledge points involved in this demo, hoping to bring convenience to beginners! poi-excel basic operations (tools) Use of custom annotations Definition of global exception capture New features of J ...

Posted by biopv on Wed, 02 Oct 2019 04:14:29 -0700

1. Spring Annotation Development, Day 1

Day 1: Spring annotation development Directory: 1, @Configuration and @Bean to Register Components for Containers 2, @ConponentScan Auto Scan Annotations I. @Configuration and @Bean Register Components for Containers 1. Creating configuration files and beans in older versions / / entity class package com.lee.bean; import lombok.AllArgsConstruc ...

Posted by GaryAC on Tue, 01 Oct 2019 13:18:03 -0700

User Authentication and Authorization of Micro Services

[TOC] AOP Implements Logon Status Check stay Chat about user authentication and authorization for micro services (Part 1) In this paper, several common authentication and authorization schemes under microservices are briefly introduced, and a minimalist demo is written using JWT to simulate Token issuance and verification.The purpose of this ...

Posted by siri on Sun, 08 Sep 2019 09:24:46 -0700

springmvc/springboot global exception handling and custom exception handling

Preface Exception handling has always been a big part of project development, but few people pay attention to exception handling. Often it's a simple try/catch all the exceptions, and then a simple print StackTrace, which uses logger at most to print down the log or re-throw the exceptions, and some have custom exceptions, but it's still in the ...

Posted by DasHaas on Sun, 08 Sep 2019 07:05:07 -0700

mall Integrates RabbitMQ to Implement Delay Messages

SpringBoot e-commerce project mall (20k+star) address: https://github.com/macrozheng/mall abstract This article mainly explains the process of mall integrating RabbitMQ to implement delay message, taking sending delay message to cancel timeout order as an example. Project Usage Framework Introduction RabbitMQ RabbitMQ is a widely used open sou ...

Posted by v4g on Mon, 02 Sep 2019 09:17:33 -0700

SpringBoot Configuration AOP Print Log

In the project development, the log system is indispensable. The parameters of input and output are printed with AOP's request on the Web. At the same time, the anomalies are printed in the log to avoid duplication of handwritten logs. For a complete case, see the source code at the end of the article. I. Spring AOP AOP(Aspect-Oriented Prog ...

Posted by Zoxive on Sat, 24 Aug 2019 08:51:24 -0700

Hibernate Validator custom validation

Preface Under my own exploration, I have a preliminary understanding of Hibernate Validator. We can use existing constraints to restrict fields, reduce the occurrence of no code, and make the code more concise.However, in recent practical use, there have been some problems that can not be handled by the framework. For example, when a third part ...

Posted by redarrow on Thu, 22 Aug 2019 20:14:21 -0700

Spring Boot: Mail Service

Articles Catalogue I. Project Initialization Configuration 1.1 Project Dependence 1.2 Project Profile 2. Code Implementation 2.1 mail entity parameter: `Mail.java` 2.2 Send Mail Interface: `MailService.java` 2.3 Implementation of Sending Mail I ...

Posted by Doyley on Thu, 15 Aug 2019 02:27:30 -0700