tags: spring cloud spring boot
The project structure is as follows:

Question: Do you have access to configuration information in NACOS in a child module?
NACOS configuration information, as follows:

The code snippet is as follows:

Solution:
1. First write a test method in the launch service controller class, if you can get the NACOS configuration, the test results are found
@Refreshscope // This annotation must be added, otherwise it will cause the NACOS configuration information to modify, it will not be refreshed here.
@RestController
public class SysLoginController
{
@Value("${xss.enabled}")
private String enabled;
@Value("${xss.excludes}")
private String excludes;
@Value("${xss.urlPatterns}")
private String urlPatterns;
。。。。。。。。。
}
2. Also increase in the CONFIG class of the child module@Refreshscope annotation,Just get the configuration information in NACOS.

the end. . . .
Get the IMG path under WebApp Use ApplicationHome to get the path to the current file, ApplicationHome can only use in the SpringBoot project....
2019 Unicorn Enterprise Heavy Recruitment Standard for Python Engineers >>> More Spring articles, welcome to clickA gray blog-spring topic The previous article mainly introduced how to obtain...
Springboot multi-module project configuration package Solve the problem of how to package multiple modules springboot parent's pom.xml pom.xml web configuration module Command to configure the eclipse...
Development tools: idea 1. Build the parent module-the idea is to create a springboot normally, and the dependent packages to be used can be selected and added to the parent pom; after the crea...
SpringBoot Multi-Module Maven Configuration 1 problem Status: Springboot multi-module project, create a project will generate a plugin by default Question: In the process of packaging, if Spring-Boot-...
2. Baidu_web project The configuration of the pom.xml file under the project is as follows: Launcher: The label needs to include @ComponentScan () to scan the bean of...
First, project related configuration 1, add bootstrap.xml and application.yml to Application.yml (the highest priority); Bootstrap.xml (NACOS registration and configuration related .Shared-Dataids: sh...
The role of nacos in the project Some configuration changes in the project need to repackage the project or modify the configuration file. These operations require the service to be updated and restar...
Nacos installation Nacos can be installed in the following two ways: 1. Download the stable version from the official website and unzip it for use. 2. Download the source code to compile and use, the ...
springboot configuration-integrated nacos Article Directory springboot configuration-integrated nacos 1. Installation information 2. Configuration release and acquisition 3. Service Registration and C...