Simply encapsulate an elegant Spring Boot global exception handling with enumeration!
Use @ ControllerAdvice and @ ExceptionHandler to handle global exceptions
@ExceptionHandler handles Controller level exceptions
ResponseStatusException
Through this article, you can understand how to handle exceptions in Spring Boot. However, just being able to use it is not enough. We have to think ab ...
Added by ahasanat on Tue, 17 Mar 2020 05:12:50 +0200
Architects must fully master the responsibility chain mode of the thorough way of kicking the ball
In our daily life, the responsibility chain mode is quite common. We usually work to handle some affairs, often all departments cooperate to complete a project task. Each department has its own responsibilities, so many times when a part of the work has been completed, it will be handed over to the next department, until all the departments hav ...
Added by PHPfolife on Mon, 16 Mar 2020 12:22:36 +0200
Design pattern prototype pattern
Archetypal model
Basic introduction
Prototype mode refers to: using prototype instances to specify the type of objects to be created, and copying these prototypes to create new objects.
Prototype pattern is a kind of creative design pattern, which allows one object to create another customizable ob ...
Added by kutchbhi on Sun, 15 Mar 2020 06:21:49 +0200
Construction of microservice parent project
1. Steps of building parent project based on IDEA
New maven project
2. Name of aggregation parent project
Maven selected version
Character encoding settings
Annotation effective activation
Java version selection 8
File Type filtering
2.pom file description
1.pom Document conten ...
Added by pha3dr0n on Sat, 14 Mar 2020 16:44:16 +0200
[java framework] springmvc -- implementation of Controller by springmvc
1. Controller implementation of spring MVC
Spring MVC implements Controller mainly in the way of Controller implementation and full annotation implementation, among which full annotation implementation is a common way in current projects.
1.1. Controller implementation mode
1.1.1. Implement Controller interface
Create a class to implement the C ...
Added by badapple on Sat, 14 Mar 2020 15:44:48 +0200
Spring Boot+Spring Security: identity authentication and role authorization based on memory database
Explain
(1) JDK version: 1.8
(2)Spring Boot 2.0.6
(3)Spring Security 5.0.9
(4)Spring Data JPA 2.0.11.RELEASE
(5)hibernate5.2.17.Final
(6)hsqldb2.4.1
1, Identity authentication and role authorization based on memory database
1.1 add dependency
Add the dependency of SpringData JPA and hsqld ...
Added by ligraci on Sat, 14 Mar 2020 09:55:20 +0200
Using pure Java to implement a websssh project
Preface
Recently, due to the needs of the project, the project needs to realize the function of websh connecting the terminal. Because of the first time to do this type of function, I first went to GitHub to find out if there is any ready-made wheel that can be used directly. At that time, I saw many projects in this area, such as GateOne, webs ...
Added by ColdFusion on Sat, 14 Mar 2020 09:04:25 +0200
Notes on learning Spring source code -- it is not difficult to download and compile Spring source code
Prerequisite preparation:
JDK8+
IDEA
Maven
Download the source code:
Visit the official website of spring.io, then go to Projects, click the kitten in the upper right corner, and download the Spring source code from Github!
Choose a RELEASE version, I choose the RELEASE version of 5.2, choose ...
Added by maniac1aw on Sat, 14 Mar 2020 03:43:45 +0200
Java single application - Architecture Mode - 03. Design mode - 24. Template mode
Original address: http://www.work100.net/training/monolithic-architecture-design-patterns-template-pattern.htmlMore tutorials: Beam cloud - free course
Template mode
Serial number
Chapter in text
video
1
Summary
-
2
Realization
-
Please refer to the navigation above for reading
1. overview
In Template Pattern, an abstract class expos ...
Added by Rollo Tamasi on Fri, 13 Mar 2020 15:53:20 +0200
How to use redis to generate serial number redis persistence
How to use redis to generate serial number
Summary
Principle introduction
Flow chart
1. Initializing serial number information into cache
2. Generate serial number
code implementation
1. Serial number entity class
2. Initialize serial number into cache
3. Generate serial number
Code testing
Gene ...
Added by Parody on Wed, 11 Mar 2020 05:38:01 +0200