Hi Patrick and my question is...relative to what...To the webapp dir? or to some fixed directory you know exists?
First of all, to calculate a releative path, you must figure what the path must be relative to. If you choose the webapp dir, like some other on this group already pointed out, you can't be sure that getRealPath() will return correct path to calculate your webapp dir and hence the relative dir outside your webapp dir. If you choose a fixed directory you know exists to calulcate a relative path from, you can reference this (relative path) from for example an action, just like any other directory...as long as your J2EE server security policies allows this...JBOSS does by default.. Maybe I don't understand your question, please feel free to guide me in the right direction, if so.. :-) ----- Original Message ----- From: "Patrick Scheuerer" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, January 12, 2004 2:32 PM Subject: Re: Storing uploaded files outside the root directory of a webapp > [EMAIL PROTECTED] wrote: > > > Hi, > > We have applied following approach in the project. > > > > A project level variable (system variable) is defined..e.g. MY_PROJECT_HOME > > > > And all file paths are resolved relative to this home.So all our configuration files(which are XML files) just give a path relative to the project home > > and a FileUtils class provides the complete path by appending any path to this PROJECT_HOME.And it has worked quite well. > > I think this is a very clean approach which separates your data files from the webapplication deployment directories.And it is reasonable to assume that any application will have its home directory set. > > The problem with this approach is that you have to have root access to the > application server in order to set an environment variable (which is not the > case in my situation). > > The solution with a properties file doesn't have this restriction. > > My main question is this: > is it possible to refer to a RELATIVE path that is outside the webapp root dir? > > e.g. webapp dir is %TOMCAT_HOME%/webapps/myapp > data dir is %TOMCAT_HOME%/data > > > Patrick > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]