springboot-madness-08-(MVC automatic configuration principle)
8. SpringBoot: MVC auto configuration principle
12.1. Official website reading
Before writing the project, we also need to know what configuration SpringBoot has made for our spring MVC, including how to extend and customize.
Only by making these clear can we use them more easily in the future. Way 1: source code analysis, way 2: official do ...
Posted by Diceman on Fri, 07 Jan 2022 21:44:02 +0100
spring mvc controller requestmapping parameter binding annotation rules and default rules
Binding: assign the information in the request to the method parameters according to the principle of name matching.
1. Request path variable @ PathVariable
Get the parameters from the request URI, excluding the query string, and? After the number.
@RestController
@RequestMapping("/user")
public class UserAction {
@GetMapping("/{id}")
...
Posted by PaTTeR on Fri, 07 Jan 2022 02:38:24 +0100
[JAVA] Spring Boot project development on exception class handling
1. Preface
Exceptions refer to abnormal phenomena that occur during the running of a program, such as user input errors, division by zero, non-existent files to be processed, array subscripts crossing bounds, and so on.
2. Classification of Exceptions
There are many exception classes defined in the JDK that correspond to a variety of possibl ...
Posted by hrichman on Thu, 06 Jan 2022 19:32:01 +0100
Spring framework IOC postprocessor mechanism
Consider the following simple program that uses file service to upload files. What should Spring do to make it run normally?
public class ApplicationContextDemo {
public static void main(String[] args) {
AnnotationConfigApplicationContext applicationContext=new AnnotationConfigApplicationContext();
applicationContext.regis ...
Posted by digibrain on Thu, 06 Jan 2022 13:04:32 +0100
ATeam community (Chapter 7 of Niuke network project)
1. Spring Security
brief introduction Spring Security is a framework that focuses on providing identity authentication and authorization for Java applications. Its strength is that it can be easily extended to meet customized requirementsfeatures
Provide comprehensive and scalable support for identity authentication and authorizationPre ...
Posted by guitarlass on Thu, 06 Jan 2022 11:39:52 +0100
Spring certified China Education Management Center - spring data tutorial II of Apache Solr
Original title: Spring certified China Education Management Center - spring data tutorial II of Apache Solr (spring China Education Management Center)
3.6. file map
Although entity mapping is already supported in SolrJ, Spring Data Solr comes with its own mapping mechanism (described in the next section).
DocumentObjectBinder has superio ...
Posted by simonoc on Thu, 06 Jan 2022 08:23:18 +0100
Call of aspect oriented programming in Spring
Knowledge point set about AOP
Concept: AOP is the abbreviation of Aspect Oriented Programming, which means Aspect Oriented Programming
Aspect oriented programming: define and encapsulate the extended method in the aspect. There is no need to modify the source code to extend the method, and there may be many aspects
Function: it can isolate e ...
Posted by adksga on Thu, 06 Jan 2022 06:07:51 +0100
Chapter 4 source code extension point of Spring - beanfactoryprocessors
I General description II Analysis of Spring source code III Examples
Premise: Spring version is 5.0 x
I General description
1. BeanFactoryPostProcessors It is an important extension point interface provided during the creation of the Spring container. It has a postProcessBeanFactory() method. When the scanning is completed according to the s ...
Posted by jmaker on Wed, 05 Jan 2022 22:11:44 +0100
The enabler of the Spring MVC interceptor (Inteceptor)
1. Monitor, filter and interceptor pairs
(1) Servlet: Processing Request requests and Response responses
(2) Filter: Filter requests before Servlet if configured to /* access all resources (servlet, js/css static resources, etc.) filter processing
(3) Monitor (
Listener
): Implemented
javax.servlet.ServletContextListener
Connected ser ...
Posted by jdlev on Wed, 05 Jan 2022 20:24:41 +0100
Relationship between beandefinition, beandefinitionfactory and beandefinitionregestry
After the Spring container is started, the bean is first read xml The configuration file, then parses the definitions of various beans in the xml file, and converts each < bean / > element in the xml file into a BeanDefinition object, in which various information of the bean read from the configuration file is saved. After readin ...
Posted by abakash on Wed, 05 Jan 2022 17:27:21 +0100