I have a Spring Boot application and want to call static
function in my @Services
which uses Configuration Properties. Say, I have a property class
@Component
@ConfigurationProperties(prefix = "connection")
public class ConnectConfig {
private String useragent;
private String referrer;
}
and a function
public class MyUtils {
public static Document connect(String url) throws IOException {
return Jsoup.connect(url).userAgent("ConnectConfig.useragent").referrer("ConnectConfig.referrer").execute().parse();
}
}
How can I have property values there?