ReloadablePropertiesFactoryBean: Beware of Caching

As Glenn pointed out, reloading properties is futile if the servlet engine returns an unchanged copy of the property file from its resource cache.

We need to find the real file anyway to check its last modification date, so overriding “loadProperties” to read from the file system absolutely makes sense.

Here’s an updated version, which correctly handles reloading of properties also from a ServletContextResource.

Download

Hinterlasse eine Antwort