File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Using resource files from external location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Using resource files from external location" Watch "Using resource files from external location" New topic

Using resource files from external location

M Sharma
Ranch Hand

Joined: Dec 13, 2001
Posts: 106
I want to package an web application by keeping resource bundle files outside war so that the user can change it easily without tampering war file.

I am using Eclipse IDE and Tomcat 5.x.

Whenever I try to keep the resource bundle outside the application, by setting it in system classpath, I am not able to refer it in the programs.

Kindly help me in this regard.

[ January 16, 2007: Message edited by: Manish Sachdev ]

Regards, Manish
SCJP 1.4
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

As you have discovered, the system classpath is not included in web apps.

One way that I have handled similar situations in the past is to identify a location, outside the web app, that the properties file will reside within. I specify this location to the web app as a context parmeter in the deployment descriptor.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Using resource files from external location
It's not a secret anymore!