###前提・実現したいこと
DIの初期化処理で読みんだコンフィグファイルを保持したい。
###発生している問題・エラーメッセージ
なし
###該当のソースコード
■サーブレットコンテキスト
<bean id="xxxxx" class="jp.ne.docomo.cima.common.container.Xxxxxxxx" init-method="init"/>
■呼び出し元
@Autowired
宣言部:private Xxxxxxxx xxxxxxxx;
呼び出し処理:xxxxxxxx.getProperty("xxx.xxxxx.xxxx");
■呼び出される側(scope指定なしのため、シングルトンのはずです。)
@Component
public class Xxxxxxxx {
private PropertiesConfiguration config = new PropertiesConfiguration();
}
###試したこと
private PropertiesConfiguration config = new PropertiesConfiguration();
↓
private PropertiesConfiguration config;
とし、初期化処理をメソッドに移動
この場合、configがnullになりました。
###補足情報(言語/FW/ツール等のバージョンなど)
なし
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/08 04:56