Meaningless Drivel is fun!*
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
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: 60782
    
  65

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: loading properties into the classpath
 
Similar Threads
class conflict in jar and war
What is the best practice to add the application property files to the classpath?
JBoss class loading and reading .properties files
Class NOT FOUND in Tomcat
struts with tomcat -not recognizing servlet.api.jar