Hello,

maybe you could save the absolute path inside a properties file 
or pass it as an init parameter in web.xml. For each location of 
your app you would have to set this path appropriately. You 
could use absolute paths and wouldn't need to change the source 
code of the application.

Regards,
Andreas


On 21 Nov 2002 at 14:31, Harsha Yalagach wrote:

> Hello,
> 
> I am running Tomcat 4.1 on Windows 2000 as a service.
> 
>     I have written a JSP page where in I am trying to read an
>     XML. If I try
> to access the file using absolute path, for eg. "c:\abc\xyz.xml",
> the page works without any problem. But if i try to access it
> thru relative path, for eg. "../data/xyz.xml", the tomcat will
> throw a FileNotFoundException saying that xyz.xml doesnt exist in
> SYSTEM-ROOT\System32 dir.
> 
>     The reason behind this is that the JSP is tring to access the
>     file from
> where JVM was started according to Java Documentation, ie
> SYSTEM-ROOT\System32 directory where the Service Control Manager
> starts the Tomcat service which in turn starts the JVM.
> 
>     So the question is, is there any other way I can use a
>     relative path
> inside my application to access a file? (I dont want to use
> absolute path as my application has to be distributed in many
> places).
> 
> Thanks in advance...
> Warm Regards,
> Harsha Yalagach
> 
> 
> --------------------------------------------------------------
> Cerebra Integrated Technologies Ltd., Bangalore, India
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]> For
> additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to