Spring can combine properties
myDir=/path/to/mydir
myFile=${myDir}/myfile.txt
You can also use a default value without defining your myFile
in the properties at first:
Properties file
myDir=/path/to/mydir
In class:
@Value("#{myFile:${myDir}/myfile.txt}")
private String myFileName;
More Related Contents:
- What causes “java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name ‘command’ available as request attribute”?
- What is the proper way to re-attach detached objects in Hibernate?
- Spring: how do I inject an HttpServletRequest into a request-scoped bean?
- Spring schemaLocation fails when there is no internet connection
- Spring Boot Multiple Datasource
- No Dialect mapping for JDBC type: 1111
- SpringBoot – making jar files – No auto configuration classes found in META-INF/spring.factories
- Service layer and controller: who takes care of what?
- Spring Boot default H2 jdbc connection (and H2 console)
- Spring autowired bean for @Aspect aspect is null
- Spring AOP not working, when the method is called internally within a bean
- Hibernate could not fetch the SequenceInformation from the database
- Java Spring @Scheduled tasks executing twice
- JPA: update only specific fields
- Maven spring boot run debug with arguments
- Spring MVC – @Valid on list of beans in REST service
- Location of spring-context.xml
- How to reload a @Value property from application.properties in Spring? [duplicate]
- Spring cron expression for every day 1:01:am
- How to use spring transaction in multithread
- Spring Data JPA: query ManyToMany
- Spring @Value annotation always evaluating as null?
- How do I create beans programmatically in Spring Boot?
- Spring 3.0 making JSON response using jackson message converter
- Anyway to @Inject/@Autowire an inner class into an outer class?
- How to specify prefix for all controllers in Spring Boot?
- Path variables in Spring WebSockets @SendTo mapping
- Spring 3.1, Hibernate 4, SessionFactory
- Spring + AspectJ weaving for java 8 using aspectj-maven-plugin
- hibernate two tables per one entity