springboot transaction flow

If there is a TestController class, TestService is injected into the class, and a transaction is opened on the TestService method test(). @RestController public class TestController { @Autowired private TestService testService; public void test() { testService.test(); } } The TestService injected into the TestControll ...

Posted on Mon, 09 Dec 2019 00:58:44 -0500 by BlueKai

Spring Cloud Series-Zuul Gateway Integrated JWT Authentication

Preface The more popular spring cloud framework has been used in these two or three years of projects, and has accumulated some time to organize and share some of the dried goods with you. This Share zuul Gateway Integrated jwt Authentication Business Background Identity authentication is essential for project development. As one of the more po ...

Posted on Mon, 09 Dec 2019 00:17:27 -0500 by blear

junit test integration of Spring

brief introduction Spring provides spring-test-5.2.1.RELEASE.jar to integrate junit. Advantage: test code can be simplified (no need to create context manually, i.e. create spring container manually) To use spring and junit integration 1. Import jar package 2. Create package com.igeek.test and create class SpringTest Use junit to integrate sp ...

Posted on Sun, 08 Dec 2019 23:10:05 -0500 by akreation

Spring boot 2. X data verification

introduce In the process of the project, it is necessary to verify the parameters. If there are few parameters, we can directly verify them by code. However, when the data is large, it will be cumbersome to use this method. Next, Validation, our main character, will come on the stage pom.xml <dependencies> <dep ...

Posted on Sun, 08 Dec 2019 22:30:38 -0500 by crouchl

es group page transport client implementation

Say in the front: There are four ways to implement the Elasticsearch Java API: TransportClient, RestClient, Jest, and Spring Data Elasticsearch.This article uses the first method, TransportClient. There are three other ways to find out: https://blog.csdn.net/qq_3331... Conclusion: 1. Automatic paging is not allowed after group, which needs to b ...

Posted on Sun, 08 Dec 2019 22:20:19 -0500 by schilly

Containerized Deployment and Application Integration for Consul Cluster Edition

background Since consul is currently the registry used by the company's main products, consul needs to use clusters to ensure high availability. The traditional way (Nginx/HAProxy) has a single point of failure. To solve this problem, I started to research how to rely only on consul for cluster registration. After a day's dilemma, it was finall ...

Posted on Sun, 08 Dec 2019 20:39:51 -0500 by hbradshaw

Spring boot file upload

Spring boot file upload Recently, there is a need to receive ios upload files in the project. During this process, I encountered a pit. I couldn't receive the value in MultipartFile in the project, and finally let the boss solve it... Record it again gradle used jar configuration file: compile fileTree(dir:'libs',include:['*. ...

Posted on Sun, 08 Dec 2019 20:10:21 -0500 by PnHoPob

Spring MVC response view

Complete project case: springmvc.zip Catalog   Example In addition to relying on spring webmvc, you also need to rely on Jackson databind (used to transform json data format) <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.9.6</versi ...

Posted on Sun, 08 Dec 2019 19:02:39 -0500 by peDey

VisualVM analysis and HelloWorld, springBoot projects

VisualVM analysis and HelloWorld, springBoot projects Since the first JDK version of JDKBeta was released in 1995, it has been nearly 25 years. In recent years, the framework of Java has been changing with each passing day. From the initial Servlet stage to SSH, SSI, SSM, springboot and so on, there are some other directions of framework micros ...

Posted on Sun, 08 Dec 2019 16:30:43 -0500 by Jmz

FastJson serializes custom return fields, and ordinary classes get bean s from spring containers

Foreword:The fields of the database, such as price:1, need price:1 yuan to return.At this time, there are two ways to modify: ① for example, modify in sql or traverse the modification before the entity class is converted to json.   ② return json and modify it during serialization. fastjson is used. fastjson version 1.2.15 or above is required ...

Posted on Sun, 08 Dec 2019 16:29:14 -0500 by Donovan