• Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing .properties from web service (Axis)

 
Manish Malik
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If a web service running on Axis/Tomcat, how would the web service load some preconfigured values from a .properties file?

For example, if the web service's Implementation class needs to access some stored key-value pairs from a .properties file, where should this file be placed?

For example,

FileInputStream myPropertiesFile = new FileInputStream("myconfig");
Properties myProperties = new Properties();
myProperties.load(myPropertiesFile);
// access properties from the object here...
myPropertiesFile.close();


Where should this file be placed (for example, in case of tomcat) for the web service to be able to read it?


Thanks.
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming you deploy the Web service in a WAR, then WEB-INF/classes is the usual location.


-Tim
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!