Spring source code analysis 2 Parse the Xml configuration file and register the BeanDefinition to the container

1. Important core interfaces 1.1 resource interface Inheritance system The Resource interface represents a Resource class, which is essentially an InputStream. It is used to read a configuration file and encapsulate it into a Resource. 1.2BeanDefinition interface BeanDefinition inheritance system According to the English meaning, bean def ...

Posted by ranjuvs on Sun, 12 Dec 2021 13:25:29 +0100

Dynamic proxy for Spring learning 10

preface advantage It can make the operation of real characters more pure! Don't pay attention to some public businessThe public business is handed over to the agent, which realizes the division of businessWhen the public business is expanded, it is convenient for centralized management Disadvantages: A real role will produce an agent, doubl ...

Posted by DarkWater on Sun, 12 Dec 2021 00:12:57 +0100

Spring boot cache principle

Three notes @Cacheable can be marked on a method or a class. When marked on a method, it means that the method supports caching. When marked on a class, it means that all methods of the class support caching. For a method that supports caching, spring will cache its return value after it is called to ensure that the next time the method is ...

Posted by anon on Sat, 11 Dec 2021 14:41:58 +0100

Introduction, use and implementation principle of mybatis spring

maven dependency <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>2.0.6</version> </dependency> use SqlSessionFactoryBean can create sqlSessionFactory. dataSource is the bean of its own data source. The @ mapperscan annotation can help us regi ...

Posted by ahsan on Sat, 11 Dec 2021 02:20:11 +0100

spring source code learning: bean loading

For the function of loading bean s, the calling methods in Spring are: MyTestBean bean = (MyTestBean)bf.getBean("myTestBean"); What function does this code realize? Let's see what's written in AbstractBeanFactory getBean public Object getBean(String name) throws BeansException { return doGetBean(name, null, null, false); } protected & ...

Posted by Slippy on Fri, 10 Dec 2021 18:11:43 +0100

Student management of SpringCloud micro service

1. Environmental construction 1.1 architecture analysis Registry: NacosGateway: GatewayBackend infrastructure: ssmFront end: Vue + SPAAxios(request.js) 1.2 database environment 1.2. 1 student database #Student database CREATE DATABASE nacos_ssm_student; USE nacos_ssm_student; CREATE TABLE tb_city( c_id VARCHAR(32) PRIMARY KEY COMMENT ...

Posted by echoninja on Fri, 10 Dec 2021 13:26:07 +0100

MultipartFile realizes file upload and download

MultipartFile is a tool class provided by spring MVC to simplify upload operations. Before the framework is not used, the native HttpServletRequest is used to receive the uploaded data. The File is passed to the back end as a binary stream, and then we need to convert it into a File class, In the Spring framework, the support for file upload a ...

Posted by Gmunky on Fri, 10 Dec 2021 09:59:13 +0100

How do I write a SpringBoot third-party dependency package?

Spring boot in this article is 2.3 Version 4 1. Spring boot features, understand the principle of automatic configuration 1.1. Dependency management Dependency management for parent project: <!-- Dependency management --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-s ...

Posted by Sj0wKOoMel on Thu, 09 Dec 2021 14:05:50 +0100

Environment preparation of 30 classes for handwritten Spring core principles

This article is excerpted from Spring 5 core principles1. Idea integrated Lombok plug-in1.1 installing plug-insIntelliJ IDEA is an excellent integrated development tool with powerful functions and many plug-ins. Lombok is an open source code generation library and a very practical gadget. When editing entity classes, we can use Lombok annotatio ...

Posted by phpdevuk on Thu, 09 Dec 2021 09:18:55 +0100

The most detailed explanation of Spring Bean's life cycle

Spring is the most popular and powerful lightweight framework in Java. The life cycle of Spring Bean is also a high-frequency interview question. Understanding the Spring Bean cycle can also better help us solve problems in daily development. Programmers should know that the basic container of spring is ApplicationContext. At the strong suggest ...

Posted by gerkintrigg on Thu, 09 Dec 2021 04:05:32 +0100