aspose file tools
The moose likes Servlets and the fly likes use of properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "use of properties file" Watch "use of properties file" New topic
Author

use of properties file

Arun Kumar
Ranch Hand

Joined: Jan 21, 2005
Posts: 128

I need to connect to a database I have specified the driver class and url in a .properties file, I have placed this .properties file in the classes folder of WEB-INF

once I create the war file and sent it to the client, They need to change the url but since we are delivering a war file they cannot do it. How can i achieve this?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6603
    
    1

Dont put it in your war file. Maintain a seperate folder where all the apps properties files will be available. If it is too late to do that you could write a program that programatically opens the war file, and replaces the properties file with the URL that the client wants. They could run it from a java program like so...

java com.RestoreProperties c:\java\warFile.war myURL

I think you should be able to open the war file using the JarFile class

http://java.sun.com/j2se/1.4.2/docs/api/java/util/jar/JarFile.html


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use of properties file
 
Similar Threads
use of properties file
Assign Config Properties from OutSide of the War File
Urgent: cannot find property file in war when packaged in ear
How to Read File inside JAR or WAR file from third WAR file
reading a properties file from the war file