SpringBoot 2.0 Base Case (03): Configure system global exception mapping handling

1. Classification of Exceptions From the point of view of handling exceptions by the system, there are two main categories of exceptions: business exceptions and system exceptions. 1. Business Exceptions Business exceptions are mainly some predictability exceptions. Handle business exceptions to prompt users for operation and improve the opera ...

Posted on Fri, 09 Aug 2019 11:18:33 -0700 by wilburforce

Lambda and Stream Practical Example Collection

Function < T, R > - Take T as input and return R as output Predicate - Take T as input and return Boolean value as output Consumer - Take T as input, perform certain operations and return nothing. Supplier - No input, return T IntConsumer - Take two T as input and return one T as output, which is ...

Posted on Fri, 09 Aug 2019 05:29:03 -0700 by msielski

Understanding: Redis Foundation Types

Articles Catalogue Understanding: Redis Foundation Types Redis characteristics install Redis data type String (string) string command Internal coding List (list) list command Internal coding Hash (hash) hash command Internal coding Set (set) set command Internal coding zset (ordered set) z ...

Posted on Fri, 09 Aug 2019 02:36:37 -0700 by gullit

Dispatcher Servlet Initialization for Spring MVC Source Learning

Servlet life cycle (review) 1. The servlet container initializes the corresponding servlet call init() method after receiving the first http request Initialized servlets are singletons, and how many servlet instances will there be in web.xml when you configure how many servlets Configuring < lo ...

Posted on Fri, 09 Aug 2019 01:53:57 -0700 by BLeez

spring-boot | Multithread Concurrent Timing Tasks

spring-boot | Multithread Concurrent Timing Tasks I just read Spring Boot's article on timed tasks, and I feel good about it. Spring Boot uses Spring's own Schedule to achieve timing tasks is very simple and convenient. Here we share. Open Cache Annotations @SpringBootApplication @EnableScheduling //Open Timing Tasks public class Application { ...

Posted on Fri, 09 Aug 2019 00:22:01 -0700 by ashz

Java Foundation 18: Java Serialization and Deserialization

Copyright Statement: This article is the original article of the blogger. It can not be reproduced without the permission of the blogger. https://blog.csdn.net/a724888/article/details/80210095 Wechat Public [Java Technology Jianghu], a technology station for an Ali Java engineer. Respond to "Java" after payi ...

Posted on Thu, 08 Aug 2019 19:45:51 -0700 by spheonix

ReentrantLock for java multithreaded summary-synchronization

1 ReentrantLock versus synchronized Both ReentrantLock and synchronized are designed to synchronize locks, but ReentrantLock is more efficient and lighter than synchronized. synchronized started with JDK1.5 and tried to optimize.By JDK1.7, the optimization efficiency has been excellent.In terms of abs ...

Posted on Thu, 08 Aug 2019 19:35:30 -0700 by kobmat

Spring-Common Notes and Role

1. Common Notes and Functions 1.1 @Configuration Declare that the current class is a configuration class (equivalent to an xml file for a Spring configuration) 1.2 @ComponentScan Automatically scan and register all classes using @Service,@Component,@Controller,@Repository under the specified package ...

Posted on Thu, 08 Aug 2019 18:46:04 -0700 by grungefreak

volatile keyword for java multithreaded summary-synchronization

Article Directory Memory Visibility of a Case Variable Atomicity of variables in two cases Memory Visibility of a Case Variable Code parsing: A new sub-thread executes the m() method, and after one second the main thread sets B to false. Will the sub-thread stop executing the dead-loop while(b){ ...

Posted on Thu, 08 Aug 2019 18:30:20 -0700 by Erkilite

A detailed explanation of dynamic proxy

1. Dynamic proxy import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; class Bingbing implements TestInter { public void findHouse() { System.out.println("Bingbing Laixi Three Flags ...

Posted on Thu, 08 Aug 2019 00:20:50 -0700 by emopoops