スプリングを使用しています。外部化されたプロパティ ファイルがあります。以下のように読み込んでいます。
<context:property-placeholder location="file:///C:/some.properties"/>
プロパティをキーと値のペアとしてセッションに保持するにはどうすればよいですか?
ServletContextListener を拡張したリスナーを書いてみました。
public class Sample implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent event) {
//here i tried to get the values of properties file as below.
InputStream stream = event.getServletContext().getResourceAsStream("C:\\some.properties");
//But here stream is coming as null
}
}
ここで何か不足していますか?
ありがとう!