可以通过Environment来获取环境注入的参数:
@RestController
public class TestController {
@Autowired
private Environment environment;
@RequestMapping("/test")
public String test(){
System.out.println(environment.getProperty("test.address"));
return "test success";
}
}