Spring boot application in-depth learning
This section mainly introduces the in-depth learning of spring boot application class related source code.
It mainly includes:
Spring boot application custom boot configuration
Spring boot application life cycle, as well as customized configuration in various stages of the life cycle.
This section uses springboot 2.1.10.release. The correspon ...
Posted by mapexdrum on Sun, 24 Nov 2019 21:07:19 -0800
After the Spring boot project is started, specific initialization operations are performed automatically (such as directly opening a page)
This article takes spring boot and automatically opens a browser to access the HTML 5 page of the project to demonstrate
Introduce two methods and recommend the second one
The first is to manually add monitoring tasks to spring, which is troublesome
Step 1: write a thread class first. After the springboot is started and load ...
Posted by bonzie on Sun, 24 Nov 2019 12:05:47 -0800
Null pointer problem of spring boot filter injection into Bean
When the doFilterInternal in the filter writes the business code, it needs to use the spring bean component. It is found that the bean component cannot be initialized in the filter, which is NullpointException. After checking, the path of the scan package is OK. Finally, determine the problem caused by the loading order of ...
Posted by Roxie on Sun, 24 Nov 2019 11:30:02 -0800
Springboot -- build your own springboot project (with log configuration)
Using spring Initalizr to build spring boot in idea
Click new item and select as shown in the figure
After clicking next
Click next, and then select as shown in the figure
Selection path
Click finish, as shown in the figure, delete what you don't want, and the project is completed
Build a controller and start the project to see the returne ...
Posted by sureshmaharana on Sun, 24 Nov 2019 07:17:55 -0800
Spring Cloud Security:Oauth2 for Single Sign On
SpringBoot e-commerce project mall (20k+star) address: https://github.com/macrozheng/mall
abstract
Spring Cloud Security provides a series of solutions for building secure SpringBoot applications, which can be implemented with Oauth2. The usage of single sign-on is described in detail in this article.
Introduction to Single Sign-on
Single Sign ...
Posted by Walker33 on Sat, 23 Nov 2019 20:17:57 -0800
Annotation ConfigurationProperties inject data into the yml configuration file
In the development of using SpringBoot, some configuration parameters need to be defined in the yml file, and then introduced through Java classes
Spring boot provides some annotations to implement this function
ConfigurationProperties
Value
EnableConfigurationProperties
The following provides examples to show how to introduce general va ...
Posted by watsmyname on Sat, 23 Nov 2019 11:58:18 -0800
Spring Cloud Security: Oauth2 used in conjunction with JWT
SpringBoot e-commerce project mall (20k+star) address: https://github.com/macrozheng/mall
abstract
Spring Cloud Security provides a series of solutions for building secure SpringBoot applications, and with Oauth2, more functions can be achieved, such as using JWT tokens to store information and refreshing tokens. This article will give a detai ...
Posted by adrianuk29 on Thu, 21 Nov 2019 18:23:31 -0800
SQL injection violation, multi statement not allow final solution
Solutions:
1. The code reports an error. The operation causing the exception is batch update. The definition of the Bean is related to Druid as follows:
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="driverClassName" value="${db.driverClassName}"/&g ...
Posted by pakmannen on Wed, 20 Nov 2019 06:28:59 -0800
springboot + rabbitmq Send Mail (guarantees 100% success and consumption of messages)
1. Throw a picture first
Explain: This article covers many aspects of RabbitMQ, such as:
Message Sending Confirmation Mechanism Consumer Confirmation Mechanism Message Re-Delivery Consumer Idempotency, etc.
These are all around the overall flowchart above, so it's necessary to post them first, see the diagram
2. Ideas for impl ...
Posted by BigToach on Tue, 19 Nov 2019 19:56:15 -0800
Take a minute to learn about Spring Security!
1. What is Spring Security?
Spring Security is a powerful and highly customizable authentication and access control framework that is the de facto standard used to protect Spring-based applications.
Spring Security is a framework for providing authentication and authorization for Java applications.As with all Spring projects, the real power of ...
Posted by g00fy_m on Tue, 19 Nov 2019 17:44:11 -0800