279.8.5.4. 適切なプレースホルダーの設定
以下は、クラスパスから myproperties.properties をロードするプロパティープレースホルダーを設定するための web.xml 設定のスニペットです。
<!-- setup property placeholder to load properties from classpath -->
<!-- we do this by setting the param-name with propertyPlaceholder. as prefix and then any options such as location, cache etc -->
<context-param>
<param-name>propertyPlaceholder.location</param-name>
<param-value>classpath:myproperties.properties</param-value>
</context-param>
<!-- for example to disable cache on properties component, you do -->
<context-param>
<param-name>propertyPlaceholder.cache</param-name>
<param-value>false</param-value>
</context-param>