Three ways to read the properties file in the resources directory

In the development process, it is often necessary to read the configuration files under the resources directory. Most of them are automatically read by the framework. If we read them manually, how can we read them? Here are three ways to read the properties file that I summarized: Read configuration file based on InputStreamGet it through the P ...

Posted by nariman on Fri, 01 Nov 2019 14:46:15 -0700

Spring framework - in depth

1.Spring IOC IOC Technology: inversion of control, also known as (dependency injection) Inversion of control: the life cycle of a Bean is not under your control, but is managed by the Spring container. How does Spring framework utilize IOC? :Spring container can help us instantiate objects, but it doesn't do DI (dependency injection). Func ...

Posted by Square1 on Wed, 30 Oct 2019 12:56:27 -0700

spring learning - AOP

I. explanatory notes @Enable aspectjautoproxy: enable spring AOP proxy @Aspect: identify the current class as a tangent for the container to read @Pointcut: declare the global pointcut. The method of declaration is only the carrier of the annotation. The specific pointcut only needs to introdu ...

Posted by jemgames on Tue, 29 Oct 2019 13:48:47 -0700

Using Mockito in Spring Boot projects

This article first appeared on personal website: Using Mockito in Spring Boot projects Spring Boot can work with most popular testing frameworks: create unit tests through Spring JUnit; generate test data to initialize the database for testing; Spring Boot can work with BDD (behavior driven development) tools, Cucumber and Spock to test applic ...

Posted by WendyLady on Sun, 27 Oct 2019 03:25:22 -0700

JPA tool class and CRUD operation instance

/** * Solve the waste of resources and time in entity manager factory * In the form of static code blocks, when a program first accesses this tool class, it creates a common entity manager factory object * * First access to getEntityManager method, create a factory object through static code blo ...

Posted by router on Wed, 23 Oct 2019 11:21:27 -0700

Sword finger offer-67-convert string to integer

subject Please write a function StrToInt to convert string to integer. Of course, you can't use atoi or other similar library functions. Back to the top thinking The topic is very simple, mainly to realize the conversion of each character into a number, and the accumulation can be done. However, there a ...

Posted by php_guy on Wed, 16 Oct 2019 12:39:38 -0700

Input and output streams (IO streams) in Java

How to use read in java: Abstract int read() reads the next byte of data from the input stream (less efficient) int read(byte[] b) reads a certain number of input streams and stores them in buffer array B. Int read(byte[] b, int off, int len) reads the most len data bytes in the input stream into the b ...

Posted by karimali831 on Sat, 12 Oct 2019 14:11:48 -0700

Spring Boot 2 Reality: mock Tests Your web Applications

1. outline Software testing is a guarantee of application software quality. java developers often ignore interface unit testing when developing interfaces. As a java development, if Mock unit tests are available, then your bug count will be greatly reduced. spring provides test test test module, so now Little Pang takes you to play with the Mo ...

Posted by zartzar on Fri, 11 Oct 2019 21:01:03 -0700

Serialization and deserialization of multiple types of variables in MessagePack Java 0.6.X

Class Packer/Unpacker allows serialization and deserialization of multiple types of variables, as shown in subsequent programs. This class enables serialization and deserialization of multiple types of variables and serialization of major types of variables as well as wrapping classes, String objects, byte [] objects, ByteBuffer objects, and so ...

Posted by spaggle on Wed, 09 Oct 2019 04:40:34 -0700

HDFS Client Operations (win10)

1. Building Development Environment 1) copy the compiled hadoop jar package to the non Chinese path. 2) Configure HADOOP_HOME environment variables 3) Configuring Path environment variables 4) Create a Maven Project HDFSClientDemo 5) Import the corresponding dependent coordinates + log additions ...

Posted by becoolufull on Sun, 06 Oct 2019 10:42:44 -0700