I'm loading application settings such as JDBC connection info from a properties file using PropertyPlaceholderConfigurer
. I'd like to also have other settings such as default locale and timezone as properties.
But I'm unsure of the best method to execute Locale.setDefault()
and TimeZone.setDefault()
. I want them run early in startup and only once. Is there a proper way in Spring to execute some code FIRST, before other code is executed? Any suggestions?
I know I can specify default values on the command line, but this application will get installed in many places and I want to avoid problems caused by someone forgetting to specify -Duser.timezone=UTC
or whatever.