Pits for synchronized lock objects
Today, I wrote something else. I happened to write synchronized. I didn't expect it to fall into the pit. Don't laugh.
At first, the code was like this:
package com.ripplechan.part_1_2_3;
import java.util.concurrent.CountDownLatch;
/**
* @author RippleChan
* @date 2018-09-20
* @time 18:05
*/
public class DataTest {
publi ...
Posted by Neoraven456 on Sat, 28 Dec 2019 11:30:12 -0800
Password encryption and microservice authentication JWT -- login function
[TOC]
Preface
I wrote an article before:< Detailed instruction of JWT for password encryption and microservice authentication>
Practical operation (practice example)
pom(common), add jwt dependency on the original basis
<dependencies>
<!--lombok-->
<dependency>
<groupId>org.projectlomb ...
Posted by jsinker on Mon, 23 Dec 2019 08:22:10 -0800
Spring Boot crater record (@ SpringBootApplication conflicts with @ ComponentScan)
I. Introduction
Let's take a look at the phenomenon. You can go first Here Download the code.
A brief introduction to the inner class
package com.iceberg.springboot.web;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
//@ComponentScan("com.iceberg.s ...
Posted by tllewellyn on Thu, 12 Dec 2019 00:57:45 -0800
JAVA implementation writing platform code generator
[CRUD is often written in the project, but in practice, I think if there is a complete code specification, it can be generated automatically and speed up the development efficiency
The technical principle of code generator is not complicated. Generally, a template is written to generate a series of codes. I saw that the code genera ...
Posted by sara_kovai on Mon, 09 Dec 2019 18:21:59 -0800
Learning record remote call (HttpClient,RestTemplate, integrate custom connection pool, integrate SpringBoot test class)
Remote call
1. overview
One project wants to call the functionality of another
"User management system" calls "commodity management system",
We call it "remote call". At this time, "user management system" is equivalent to simulating "browser".
2. Call mode
RPC: the remote call mode of c ...
Posted by callmubashar on Fri, 06 Dec 2019 04:33:48 -0800
Deep understanding of lambda expression and functional programming functional interface source code analysis
package com.java.design.java8;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Arrays;
import java.util.Compar ...
Posted by jordz on Tue, 03 Dec 2019 01:56:08 -0800
Spring boot reads the folder in resource under jar package
Some time ago, in the development process based on springboot, we encountered a problem: the program needs to read all the files of a directory under resource, and it needs to be able to read them in the form of file. However, after packaging, the springboot project becomes a jar package. When reading the file, an error will be rep ...
Posted by jfourman on Sat, 30 Nov 2019 09:51:35 -0800
Implementation of distributed globally unique ID generator (supporting multiple registries)
In the business scenarios of order and payment, the generation rules and methods of DOC No. are very important. There are many kinds of implementation. The simplest one is based on mysql auto add primary key. The advantages and disadvantages of the scheme are not much discussed, and everyone knows. Today, we implement a distrib ...
Posted by lentin64 on Fri, 29 Nov 2019 12:02:28 -0800
mysql8+mybatis-plus3.1 automatically generate interface with lombok, swagger, addition, deletion, modification and query
mybatis-dsc-generator
Perfect integration of lombok, swagger code generation tools, so that you no longer worry about cumbersome comments and simple interface implementation: entity integration, format verification, swagger; dao auto add @ mapper, service auto comment and dependency; controller to achieve single table add / modify, and realize ...
Posted by AIS4U on Fri, 29 Nov 2019 10:54:11 -0800
The arrangement and use of jar package in Java development
This article collates the jar packages and API records that I often use in Java development.
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<ve ...
Posted by ramli on Mon, 25 Nov 2019 05:46:52 -0800