Detailed explanation of spring boot static variable injection configuration file
This example shares the specific code of spring boot static variable injection configuration file for your reference. The specific contents are as follows
Spring static variable injection
Spring does not support direct injection of static variable values. Let's take a look at the code:
The configuration file is as follows:
Use the logbrokerlist variable when the project starts
Execution results:
terms of settlement
Use spring's set injection method to inject static variables through the non static setter method. We can change it so that the static variables can obtain your configuration information:
Execution results:
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.