SpringBoot implements multiple data source configuration
Spring boot for multi data source configuration
springBoot implements the configuration of multiple data sources application.properties Configure two data sources in
spring.datasource.primary.url=jdbc:mysql://localhost:3306/test1
spring.datasource.primary.username=root
spring.datasource.primary.password=root
spring.datasource.primary.driv ...
Posted on Mon, 20 Jul 2020 12:04:53 -0400 by Julian Pedley
The first springboot project
The company's recent projects use some components in springboot and springcloud. At first, they mainly write some business code, do not know how to configure it, etc. So recently, just have time to learn, record and summarize, and welcome to make corrections.
Start the first springboot project (eclipse+maven):
1. New maven project, add depend ...
Posted on Fri, 17 Jul 2020 11:28:51 -0400 by businessman332211
Two ways to implement page layout using thymeleaf template
Method 1:
Using thymeleaf Layout:fragmentLabel, layout page as follows:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta nam ...
Posted on Thu, 09 Jul 2020 10:44:41 -0400 by Dethman
After the upgrade of Spring Boot, the initialization SQL does not run?
Spring Boot unit tests automatically execute test scripts
cause
Recently, we are upgrading our microservices from SpringBoot 1.5.x to 2.x. During this period, some configuration changes were made, and the configuration changes of SpringBoot itself made it impossible to run the unit test after the up ...
Posted on Mon, 29 Jun 2020 03:22:12 -0400 by Hurklefish
Combination of graphics and text to teach you how to initialize Tomcat and how to run Tomcat in SpringBoot
How to initialize Tomcat in SpringBoot
preface
The creation of spring boot simplifies our work of creating and running projects. We don't have to package the project into a jar package, then put it into Tomcat and start it again, as in the spring MVC era. We can ignore the packaged operation and tom ...
Posted on Mon, 29 Jun 2020 00:12:31 -0400 by abhi_10_20
RabbitMQ and SpringBoot integration
To integrate RabbitMQ with SpringBoot, first we need to create a new SpringBoot project, which is divided into two sub modules: producer and consumer. Then we need to introduce related RabbitMQ dependencies, as follows:
<dependency>
<groupId>org.springframework.boot</groupId>
< ...
Posted on Fri, 26 Jun 2020 00:47:20 -0400 by Roman Totale
Common knowledge accumulation of spring boot development
Article catalog
SpringBoot get Request and Response
Transaction uses @ Transactional
AOP development process
SpringBoot get Request and Response
Through static method acquisition, you can also encapsulate a static method
public String test() {
ServletRequestAttributes attributes = (ServletReque ...
Posted on Thu, 25 Jun 2020 06:50:11 -0400 by expert_21
Property Injection
Injection in springboot
Basic Property Injection @Value
Object Mode Injection @ConfigurationProperties
Comparison of two injection modes
Injection Details
Profile Injection Value Data Check@Validated
Load the specified configuration file @PropertySource
Import Spring's Configuration File@ImportResou ...
Posted on Wed, 24 Jun 2020 22:41:17 -0400 by RonDahl
Spring boot source code analysis
Every time we create a springboot Application, we will find that there will be an Application class (hereinafter referred to as the Application class directly) headed by the Application name in its directory structure, while other packages are under the same level or child level of this class, as sho ...
Posted on Wed, 24 Jun 2020 03:01:03 -0400 by msurabbott
Configuring WebSocket connection with Vue+SpringBoot
Front end Vue
Using constructors to build Websocket objects
WebSocket(url[, protocols])
The callback functions of the object are:
WebSocket.onclose
Used to specify the callback function after the connection is closed.
WebSocket.onerror
Used to specify the callback function after a connection fa ...
Posted on Mon, 22 Jun 2020 23:56:47 -0400 by oskom