Spring source reading - 4
Creation of BeanDefinitionHolder
The inheritance structure of BeanDefinition in the Spring framework is as follows:
BeanDefinition is the internal representation of the configuration file < bean > element label in the container. The < bean > element tag has class, scope, lazy init and other configuration attributes, while BeanDe ...
Posted by dakkonz on Tue, 31 Dec 2019 18:11:42 -0800
Spring cloud spring boot mybatis distributed micro service Cloud Architecture Development Web Application
After completing the configuration, take a simple example. Based on the quick start project, take a simple example to render a page through Thymeleaf.
@Controller
public class HelloController {
@RequestMapping("/")
public String index(ModelMap map) {
// Add a property to read from the template
map.addAttribute(" ...
Posted by Paul Arnold on Tue, 31 Dec 2019 17:03:19 -0800
Spring+redis sentinel master-slave switch
Spring+redis sentinel master-slave switch (failover)
redis sentinel configuration reference: http://www.cnblogs.com/yjmyzz/p/redis-sentinel-sample.html
Reference for the integration of redis sentinel and spring: http://www.cnblogs.com/yjmyzz/p/integrate-redis-with-spring.html
For redis object caching, please refer to the abov ...
Posted by n00b Saibot on Tue, 31 Dec 2019 10:21:24 -0800
JavaLib | Result unifies your API (2)
Introduction
JavaLib has implemented the Result module for a long time, and I've been using it, but that's for the public API interface. If the back-end developers write the API interface to the front-end like that, it's very troublesome, so they decided to rewrite it early. I also refer to a lot of people. Looking at the Spring Builder mode, i ...
Posted by willeh_ on Tue, 31 Dec 2019 10:03:47 -0800
Are bean s in spring thread safe?
Spring does not guarantee thread safety of bean s.The bean s in the default spring container are singleton. When there is a race condition in a single case, there is a thread safety problem. As the following example
Counting class
package constxiong.interview.threadsafe;
/**
* Counting class
* @author ConstXiong
* @date 2019-07-16 1 ...
Posted by hucklebezzer on Mon, 30 Dec 2019 20:03:08 -0800
How does the dao interface of mybatis relate to sql in the xml file?Step by step analysis
Preface
Before you begin the body, explain how the Dao interface corresponds to the SQL in the XML file.
At the end of a sentence, mybatis parses these xml files, establishes a relationship with Dao through the namespace ins id e the xml file, and then associates each sql in the xml with an interface in dao.
The question then arises:'If I have ...
Posted by mike_at_hull on Mon, 30 Dec 2019 17:47:17 -0800
Spring boot basic tutorial 2-1-11 RestTemplate integration HttpClient
1 Overview
Http request is essential in server development. In this paper, RestTemplate is used as the facade and HttpClient is used as the implementation to demonstrate the basic Http request example.
2 source code analysis
2.1 add pom.xml dependency
RestTemplate is built in the spring web module, and spring boot is introduced automatically
...
Posted by Whitestripes9805 on Mon, 30 Dec 2019 13:46:27 -0800
What are the common injection methods of spring?
1. Configuration in xml
bean declaration and registration
< bean > node register bean Factory bean parameter of < bean > node refers to factory bean, and factory method parameter specifies factory method
bean injection
< property > nodes are injected in set mode < constructor Arg > node injection with construc ...
Posted by cornelombaard on Mon, 30 Dec 2019 06:13:24 -0800
[Spring Boot AOP records user operation logs] 1. Integrate mybatis basic framework
In the Spring framework, using AOP with custom annotations can facilitate the monitoring of user operations. First, build a basic Spring Boot Web environment to start Spring Boot, and then introduce the necessary dependencies:
<dependency>
<groupId>org.springframework.boot</groupId>
<artif ...
Posted by dirTdogE on Mon, 30 Dec 2019 06:08:42 -0800
Exercises 1.3.14 and 1.3.19(Java implementation)
Recently, we are gnawing at data structure and algorithm. Welcome to communicate.
1.3.14: implement queue (FIFO) with variable length array
Implementation of data structure ResizingArrayQueueOfStrings:
public class ResizingArrayQueueOfStrings {
String[] arr;
int N;
public ResizingArrayQueueOfStrings(int cap) {
arr ...
Posted by The Swedish Tower on Sun, 29 Dec 2019 11:20:14 -0800