You can use the @Value
annotation and access the property in whichever Spring bean you’re using
@Value("${userBucket.path}")
private String userBucketPath;
The Externalized Configuration section of the Spring Boot docs, explains all the details that you might need.
More Related Contents:
- Immutable @ConfigurationProperties
- Spring Boot and multiple external configuration files
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- Add context path to Spring Boot application
- Spring Boot – Handle to Hibernate SessionFactory
- Unable to get spring boot to automatically create database schema
- How to maintain bi-directional relationships with Spring Data REST and JPA?
- How to use YamlPropertiesFactoryBean to load YAML files using Spring Framework 4.1?
- Why does my Spring Boot App always shutdown immediately after starting?
- The request was rejected because no multipart boundary was found in springboot
- Change database schema used by Spring Boot
- Mapping list in Yaml to list of objects in Spring Boot
- Spring Boot and custom 404 error page
- Multipart File upload Spring Boot
- Filtering data with Spring boot CrudRepository
- SpringRunner vs SpringBootTest
- Spring Boot Externalizing properties not working
- Spring: overriding one application.property from command line
- Spring-boot: required a bean named ‘entityManagerFactory’ that could not be found
- How to set SameSite and Secure attribute to JSESSIONID cookie
- How set up Spring Boot to run HTTPS / HTTP ports
- How can I serve static html from spring boot?
- Spring-Boot How to properly inject javax.validation.Validator
- How to log all active properties of a spring boot application before the beans instantiation?
- How to specify prefix for all controllers in Spring Boot?
- Spring Boot access static resources missing scr/main/resources
- bootstrap.yml configuration not processed anymore with Spring Cloud 2020.0
- How to modify request body before reaching controller in spring boot
- Spring Boot – Reading Text File using ResourceLoader
- Enabling CORS globally in Spring Boot