aspose file tools*
The moose likes Spring and the fly likes Dynamic Property File Loading in Spring based on the URL Argument. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Dynamic Property File Loading in Spring based on the URL Argument." Watch "Dynamic Property File Loading in Spring based on the URL Argument." New topic
Author

Dynamic Property File Loading in Spring based on the URL Argument.

Naresh Tota
Greenhorn

Joined: Aug 07, 2012
Posts: 2
Hi, I am working in a environment which needs to load/change the property files based on the URL argument. But the problem is based on the configuration all the property files are loading before getting the URL argument.

Consider that My root-context.xml file contains the configuration like following...


I am loading the property files from the classpath by default...
After complete build of application and I will deploy the application in server and runs it. When I am sending the request I will send some argument as "c=um" as part of url. So I need to get this argument and change the property file based on this argument or load the property files.

The Questions are: Can I change the name of the property file in configuration

After changing the name can I reload the property files with out restarting the application.
Vinit Prajapati
Greenhorn

Joined: Jan 10, 2008
Posts: 2

Hi,

Instead of changing filename in configuration file.

load properties file programatically



Vinit
Naresh Tota
Greenhorn

Joined: Aug 07, 2012
Posts: 2
Yes, We can load the properties programmatically, but its not the case. After successful build of application, for the first request I need to get an argument from the URL, and based on that argument I have to load the properties i.e, my application has to run with new properties instead of old properties which are loaded before getting the URL argument.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1680
    
    7

Please read BeForthrightWhenCrossPostingToOtherSites

http://forum.springsource.org/showthread.php?129117-Dynamic-Property-File-Loading-in-Spring-based-on-the-URL-Argument


[How To Ask Questions][Read before you PM me]
 
 
subject: Dynamic Property File Loading in Spring based on the URL Argument.