プロパティ pA を持つ Bean A があります。ここで、このプロパティを別の Bean B のプロパティ pB に注入したいと考えています。$ と # の両方で @Value を使用しようとしましたが、機能しません。これが私のB級です。
@Component
public class B
{
@Value("${a.aP}")
private boolean bP;
}
クラス A は次のようになります。
@Component
public class A
{
private boolean aP;
if(some condition){
aP = true;
}
}