import org.springframework.beans.factory.annotation.Value;
I used spring@value to get value from config, it works fine in other class(controller and other service), but it does not work in a model:
public final class Page {
@Value("${defaultUrl}")
private static String defaultUrl;
private String url;
public Page(String url) {
this.url = url;
}
public Page() {
this(defaultUrl);
}
}
In the above case, it is not possible to get defaultUrl from Spring.value. Anyone know why?