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

Application context context context of Spring key interface

catalog 1.ServletContextListener interface 2.ApplicationContextInitializer interface 2.1 integration mode of springboot 2.2 integration mode of spring MVC 3.ApplicationListener interface and supporting classes 3.1 ApplicationListener interface and supporting class ApplicationEvent 3.2 Applicat ...

Posted on Mon, 22 Jun 2020 03:30:06 -0400 by d_mc_a

Spring boot auto configuration principle

Spring boot auto configuration principle For example, spring boot's auto configuration principle is similar to the restaurant's mechanism. For my favorite fish scout recently, if we compare spring boot to fish scout and dinner to our application, when we come to fish scout for dinner (equivalent to ...

Posted on Fri, 19 Jun 2020 07:43:01 -0400 by devinemke