I have a class Config
:
Config.java
public class Config {
private final String p = "Prop";
@Bean
public String getP(){return p;}
}
How do I inject this to some constructor, ie:
public class SomeC {
private String p;
public SomeC(String p) {
this. p = p;
}
}
I want this String p
to have injected value from Config. Is that possible?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…