Spring boot (11) - exception handling and custom error page

1. Abnormal source To handle an exception that occurs in a program, you first need to know where the exception comes from? 1. The front-end wrong request path will cause 4xx errors in the program, the most common is 404. By default, when this error occurs in the spring boot request path, the pc response page is as follows If it is mobile termi ...

Posted by scott_ttocs46 on Tue, 26 Nov 2019 08:39:14 +0100

Things management and caching in MyBatis

Things about MyBatis The concept of things In the framework of Java language database, the transaction management of database is very important. Each business logic is completed by a series of database accesses, which may modify multiple data records. This series of modifications should be a whole, and it is absolutely not allowed to modify onl ...

Posted by Sonic_Rage on Tue, 26 Nov 2019 06:13:06 +0100

Springboot Series Do you really know Swagger documentation?

Preface At present, it is quite popular to build a microservice using Springboot in Java. When building a microservice, most of us choose to expose a REST API for invocation.Or the company uses a separate front-end and back-end development model where front-end and back-end work is developed by completely different engineers.Maintaining a compl ...

Posted by tristanlee85 on Tue, 26 Nov 2019 02:42:03 +0100

Spring Q & a series 1 -- differences between beanfactorypostprocessor and BeanPostProcessor

It seems that BeanFactoryProcessor and BeanPostProcessor can control the instantiation process of Bean. This article will explain the concepts and differences between them. What is BeanFactoryPostProcessor The source code of BeanFactoryPostProcessor is as follows: public interface BeanFactoryPostProcessor { void postProcessBeanFactory(Confi ...

Posted by jvrothjr on Mon, 25 Nov 2019 21:52:04 +0100

Unfortunately, Spring Bean initialization / destruction has so many postures

Source: http://1t.click/bfHN I. Preface The daily development process sometimes needs to load some resources after the application is started, or release resources before the application is closed. The spring framework provides related functions. Around the Spring Bean life cycle, you can initialize resources in the Bean creation process and ...

Posted by cute_girl on Mon, 25 Nov 2019 21:10:55 +0100

MybatisGenerator extension: Custom comment generator

MybatisGenerator extension: Custom comment generator I believe you have a certain understanding of the mybatisgenerator. I love and hate it. The code generated by the mybatisgenerator plug-in will generate comments, which are all useless to us. Although it can prevent the generation of comments, it is not good to have no comme ...

Posted by trrobnett on Mon, 25 Nov 2019 20:57:54 +0100

Unfortunately, Spring Bean initialization / destruction has so many postures

Source: http://1t.click/bfHN I. Preface The daily development process sometimes needs to load some resources after the application is started, or release resources before the application is closed. The spring framework provides related functions. Around the Spring Bean life cycle, you can initialize resources in the Bean creation process and ...

Posted by Gnub on Mon, 25 Nov 2019 20:17:54 +0100

Get the time of the previous day and the next day in Java

                Today, when developing a project, we encounter a problem that is how to get the day before and the day after the current time. The logic of this implementation is not complicated, and it is not difficult to write by yourself, but it seems that there is no need to write such a method by yourself. Think about the C ...

Posted by sergio-pro on Mon, 25 Nov 2019 19:00:44 +0100

Talk about springboot jet autoconfigure

order This paper focuses on springboot jet autoconfigure JestProperties spring-boot-autoconfigure-2.1.4.RELEASE-sources.jar!/org/springframework/boot/autoconfigure/elasticsearch/jest/JestProperties.java @ConfigurationProperties(prefix = "spring.elasticsearch.jest") public class JestProperties { /** * Comma-separated list of the Elasticsearc ...

Posted by TheKiller on Mon, 25 Nov 2019 16:19:44 +0100

Detailed explanation of HashMap principle

The source code of this article is based on jdk8 version. Let's talk about the core basic and key and difficult knowledge of hashMap Summary 1. Constructor II. put operation 1. hash function 2. Array subscript calculation 3. Operation steps summary III. resize Expansion of jdk1.8 How to avoid the concurrent problem that leads to the chai ...

Posted by tmharrison on Mon, 25 Nov 2019 11:58:44 +0100