I have a class that uses a static block to initialize a static hashtable. This is done by reading the properties file, analyzing the contents of the file, and then setting the appropriate values in the Hashtable.
However, instead of specifying the location of the file, I would like to enter the location instead using Spring, mainly to eliminate any hard-coded values in the class. I saw somewhere else that you can actually enter a static variable, but this will be due to the use of a non-static setter.
So my question is: will the setter be called before the static block is executed, or will the static block be executed before Spring calls the installer (which will basically throw an exception in my code)?
Thank!
source
share