Spring PropertySource and Environment

Brent Putman putmanb at georgetown.edu
Thu May 8 18:56:55 EDT 2014


In poking around, I discovered something else interesting about
PropertySource usage.  In a web application context, in addition to the
default ProperySource impls which read from system properties and from
environment vars, the web context gets 2 additional ones that read from
servlet context and servlet init params. 

One could do PropertySource-based replacement based on those directly, I
suppose.

It also means, I think, that in an ApplicationContextInitialzier impl,
one could for example read a base directory property from one of those
params (system/environment/servlet) by using the appropriate
PropertySource from the context that is passed in, and then load up some
new properties relative to that for a new PropertySource, or whatever. 
Maybe useful, maybe not.

Fwiw, there is also a JNDI PropertySource impl included.

Looks like writing a custom PropertySource impl is also pretty easy, so
that's an option too.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/dev/attachments/20140508/3fb0da95/attachment-0001.html 


More information about the dev mailing list