Global exception handling using enhanced ControllerThe so-called enhanced Controller is the @ ControllerAdvice annotation. Some annotations of the methods in the class with this annotation will be applied to all controllers, including the @ ExceptionHandler annotation.So you can write a global exception handling class:
* Created by 47
Posted by roel_v on Wed, 11 May 2022 02:39:57 +0300
1. Introduction to mybatis
1.1 what is MyBatis?
MyBatis official website
MyBatis is an excellent persistence layer framework that supports common SQL queries, stored procedures and advanced mapping. MyBatis eliminates almost all the manual setting of JDBC code and parameters and the retrieval of result sets. MyBatis uses simple XML or ann ...
log4j Log4j is an open source project of Apache. We can control log information through it. The output destination is console and file Usually in log4j Properties in configuration Function: control the format and process of each log output
# Global logging configuration
# Console output...
Posted by nikifi on Tue, 10 May 2022 15:48:02 +0300
Step 1: build an integrated environment Step 2: build a Spring development environment Step 3: integrate Spring MVC with Spring Step 4: integrate Mybatis with Spring We first configure each framework to ensure that each framework can be executed separately, and then carry out the integration operation.
Integrated environme ...
Posted by eyegraphix on Tue, 10 May 2022 12:13:18 +0300
1, Dynamic agent
1. Export mode
Code confusion: after more and more non business requirements (logging, verification, etc.) are added, the original business methods expand sharply Each method must take into account many other concerns while dealing with the core logic
Code dispersion: take the log requirement as an example. In order to m ...
Posted by Bad HAL 9000 on Mon, 09 May 2022 23:03:52 +0300
If the article is inappropriate, please summarize it for your own reference.
The source code of this article has been uploaded to Baidu online disk.
Extraction code: ric4
Spring Boot is a new framework provided by pivot team. It is designed to simplify the initial const ...
Posted by jacko_162 on Mon, 09 May 2022 15:19:03 +0300
Source: Liao Xuefeng's official website
In AOP programming, we often encounter the following concepts:
Aspect: aspect, that is, a function across multiple core logic, or system concern;
Joinpoint: connection point, which defines where to insert the execution of the aspect in the application process;
Pointcut: entry point, that is, a set of con ...
Posted by BRUUUCE on Mon, 09 May 2022 11:11:16 +0300
Taking the spring container created in the Web project as the starting point, this paper describes the initialization process of WebApplicationContext. Spring version 4.3.18 RELEASE.
1, Initialization entry
In the development of Web project based on Servlet+Spring, if the implementation class of WebApplicationContext is no ...
Posted by g00fy_m on Sun, 08 May 2022 20:14:13 +0300
What is annotation
What is the Spring framework
Relationship between SpringBoot and SpringClound
Common SpringBoot project development methods
Recommended solutions for learning new technologies
What is annotation
Java annotation is some meta information attached to the code, which is used for parsing and using some tools dur ...
Posted by chigley on Sun, 08 May 2022 09:10:50 +0300