'Does Spring framework @value annotation work with other frameworks?
I am developing a library with a Spring framework and adding as a dependent for different frameworks. Does Spring framework @Value annotation inside library work for different frameworks that take application properties from other frameworks and also from spring boot too? Or do I have to use pure Java with a resource bundle?
Spring-Boot library:
@EnableAutoConfiguration
@Configuration
public class ClientProperties {
@Value("${application.url:#{null}}")
public String baseApplicationUrl;
public static String application_url;
@Value("${application.username:#{null}}")
public String platformUsername;
public static String username;
@Value("${application.password:#{null}}")
public String platformPassword;
public static String password;
A client application using a different framework that is not spring. Application properties file as follow:
application.url="localhost"
application.username=test
application.password=test
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|