This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes loading properties into the classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "loading properties into the classpath" Watch "loading properties into the classpath" New topic
Author

loading properties into the classpath

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Hi, I found out that it is possible to load .properties files into the classpath by simply adding them to the WEB-INF/classes directory and then starting Tomcat. Is also possible to load classes by placing them in WEB-INF/lib? Or do the only files loaded from WEB-INF/lib include .jar files?

I have a jar file that is going to run on a 3rd party j2ee application and I do not have access to a classes directory, but I need to add a property file into the classpath.

Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

do the only files loaded from WEB-INF/lib include .jar files?


True.

You either need to put the properties file in the WEB-INF/classes hieararchy, or put it in a jar file to drop into WEB-INF/lib.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
That works. Thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: loading properties into the classpath